In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Construction of LAMP:
Using two virtual machines, one virtual machine installs httpd and php, compiles php as a module into httpd, and the other installs mysql, so that php can call mysql to read data.
Virtual machine 1VR 172.18.250.76 Centos6.7 install httpd, php
Virtual machine 2VR 172.18.250.10 Centos6.7 install mysql
Use httpd to create two domain name-based virtual hosts that run wordpress blog and phpmyadmin database respectively.
One: yum installs httpd
[root@localhost ~] # yum-y install httpd
1. Edit the configuration file and comment on DocumentRoot
[root@localhost ~] # vim / etc/httpd/conf/httpd.conf#DocumentRoot "/ var/www/html"
2. Create virtual host files and edit files
[root@localhost php] # vim / etc/httpd/conf.d/vhost.confNameVirtualHost 172.18.250.76 etc/httpd/conf.d/vhost.confNameVirtualHost 80 ServerName www.a.com DocumentRoot "/ www/blog" Options None Allowoverride None Order allow,deny allow from all ServerName www.b.net DocumentRoot "/ www/php" Options None Allowoverride None Order allow,deny allow from all
3. Start the httpd service and view the listening port
[root@localhost php] # netstat-ntlpActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0:: 80: * LISTEN 2201/httpd
4. Create a virtual host path and verify whether it can be accessed properly.
[root@localhost conf.d] # mkdir-p / www/blog [root@localhost conf.d] # mkdir-p / www/php [root@localhost conf.d] # cd / www/php [root@localhost php] # echo "[root@localhost conf.d] # cd / www/blog [root@localhost blog] # echo" www.a.com "> index.html
Restart the httpd service and verify:
II. Install php for yum
[root@localhost php] # yum-y install php [root@localhost php] # httpd-M / / View the module php5_module (shared) / / php loaded by httpd has been edited into httpd
Verify that the php loads properly:
[root@localhost php.d] # vim / www/blog/index.php
Third, install mysql
[root@lsj ~] # yum-y install mysql-server [root@lsj ~] # service mysqld start
Authorize a remote account so that PHP can access mysql
Mysql > grant all on *. * to admin@'172.18.250.76' identified by "admin"
Install mysql driver and support php remote
[root@localhost modules] # yum-y install php-mysql [root@localhost modules] # vim / www/blog/index.php
Install wordpress and phpmyadmin software
[root@localhost wordpress] # unzip wordpress-4.3.1-zh_ define [root @ localhost blog] # cd wordpress [root@localhost wordpress] # cp wp-config-sample.php wp-config.php [root@localhost wordpress] # vim wp-config.php / * * name of the WordPress database * / define ('DB_NAME',' mytest'); / * MySQL database user name * / define ('DB_USER',' admin') / * * MySQL database password * / define ('DB_PASSWORD',' admin'); / * MySQL host * / define ('DB_HOST',' 172.18.250.10')
Verify that you can log in normally:
Log in to the blog:
[root@localhost blog] # cd / www/php/ [root@localhost php] # unzip phpMyAdmin-4.4.14.1-all-languages.zip [root@localhost php] # ln-s phpMyAdmin-4.4.14.1-all-languages pma
Generate a random number that is used to log in to phpmyadmin
[root@localhost pma] # cp config.sample.inc.php config.inc.php [root@localhost pma] # openssl rand-base64 30d8yhR7wOU5+HzeZjGEusyAmNiQv/+rTzWQuoDiCR [root@localhost pma] # vim config.inc.php$cfg ['blowfish_secret'] =' d8yhR7wOU5 = 'd8yhR7wOU5' HzeZjGEusyAmNiQvAccording to rTzWQuoDiCROs ['Servers'] [$] [' host'] = '172.18.250.10'
Verify that the page can be opened:
Install a php-mbstring that supports the Chinese character set
[root@localhost pma] # rpm-ivh php-mbstring-5.3.3-40.el6_6.x86_64.rpm
Refresh the page:
Enter the password of the account just authorized:
.
The solution is as follows:
1. Upgrade the mysql version.
2. Downgrade phpmyadmin version.
The way to downgrade the version:
[root@localhost pma] # cd libraries/ [root@localhost libraries] # vim common.inc.phpif (PMA_MYSQL_INT_VERSION < 50500) {changed to if (PMA_MYSQL_INT_VERSION < 50100 {
Refresh again and enter the account password:
OK, database login succeeded.
5. Install Xcache to accelerate php
[root@localhost libraries] # yum-y install php-xcache
1. Test the request speed before acceleration is enabled:
[root@localhost setup] # ab-N100-c10 http://172.18.250.76/wordpress/index.phpBenchmarking 172.18.250.76 (be patient). DoneServer Software: Apache/2.2.15Server Hostname: 172.18.250.76Server Port: 80Document Path: / wordpress/index.phpDocument Length: 0 bytesConcurrency Level: 10Time taken for tests: 4.792 secondsComplete requests: 100Failed requests: 0Write errors: 0Non-2xx responses: 100Total transferred: 36800 bytesHTML transferred: 0 bytesRequests per second: 20.87 [# / sec] (mean) Time per request: 479.161 [ms] (mean) Time per request: 47.916 [ms] (mean Across all concurrent requests) Transfer rate: 7.50 [Kbytes/sec] receivedConnection Times (ms) min mean [+ /-sd] median maxConnect: 0 1.3.80 20Processing: 143,459 331.6 1783Waiting: 143,458 331.6 343 1783Total: 143,460 331.4 1783Percentage of the requests served within a certain time (ms) 50% 360 66 405 75% 512 80% 581 90% 895 95% 1375 98% 1720 99% 1783 100% 1783 (longest request)
2. Restart the httpd service, open Xcache, and test
[root@localhost setup] # ab-N100-c10 Benchmarking 172.18.250.76 (be patient). DoneServer Software: Apache/2.2.15Server Hostname: 172.18.250.76Server Port: 80Document Path: / wordpress/index.phpDocument Length: 0 bytesConcurrency Level: 10Time taken for tests: 1.659 secondsComplete requests: 100Failed requests: 0Write errors: 0Non-2xx responses: 100Total transferred: 36800 bytesHTML transferred: 0 bytesRequests per second: 60.27 [# / sec] (mean) / / Triple acceleration request Time per request: 165.908 [ms] (mean) Time per request: 16.591 [ms] (mean Across all concurrent requests) Transfer rate: 21.66 [Kbytes/sec] receivedConnection Times (ms) min mean [+ /-sd] median maxConnect: 0 12.60 10Processing: 41 158 27.5 158 235Waiting: 40 158 27.6 158 235Total: 41 159 28.7 158 245Percentage of the requests served within a certain time (ms) 50% 158 66% 166 75% 168 80% 171 90% 192 95% 213 98% 240 99% 245% 245% 245 (longest request)
Six: carry out SSL encryption authentication when visiting phpmyadmin web pages
How to carry out visa and CA authentication can refer to my blog post: encryption and decryption technology in Linux and CA authentication
1. Download the mod_ssl module first, because httpd2.2 does not include this module
[root@localhost ssl] # yum-y install mod_ssl
2. Edit / etc/httpd/conf.d/ssl.conf file
[root@localhost ssl] # vim / etc/httpd/conf.d/ssl.conf DocumentRoot "/ www/php" / / uncomment, modify the virtual host's urlServerName / / virtual host name SSLEngine on / / ensure that it is onSSLCertificateFile / etc/httpd/ssl/httpd.crt / / where the signed certificate SSLCertificateFile / etc/httpd/ssl/httpd.key / / holds the private key
3. Restart the httpd server to see if port 443 is enabled.
[root@localhost ssl] # netstat-ntlptcp 0 0: 443: * LISTEN 6080/httpd
4. Verify that the page can be accessed
Download the CA certificate from the virtual machine to the windows host
[root@www CA] # sz cacert.pem
6. Import the certificate into the browser
7. Reopen the browser and enter the virtual host name:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.