This article uses an example to describe how to quickly build a LAMP environment on the CentOS platform. Share with you for your reference, the details are as follows: LAMP -- Linux Apache MySQL PHP The order of installation on CentOS is usually Apache -> MySQL -> PHP Step 1: Install and configure Apache 1. Install using yum yum install httpd 2. Modify the firewall configuration and open port 80. You can also open port 3306 of MySQL. vi /etc/sysconfig/iptables Add two records -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT Note the location of the addition, as shown below 3. Turn off SELINUX vi /etc/selinux/config Modify SELINUX=disabled 4. Apache configuration file vi /etc/httpd/conf/httpd.conf Find ServerName and set it to your own domain name. If you don’t have a domain name, you can set it to localhost:80 5. Automatically start Apache at boot chkconfig httpd on 6. Restart Apache service httpd restart 7. Open the browser and enter the address test Step 2: Install and configure MySQL 1. Install using yum yum install mysql mysql-server 2. Automatically start MySQL at boot chkconfig mysqld on 3. Set the root password for MySQL mysql_secure_installation After pressing Enter, enter y to set the password. After setting the password, press Enter all the way until the following message appears: Thanks for using MySQL! 4. Restart MySQL service mysqld restart Step 3: Install and configure PHP 1. Install using yum yum install php 2. Install PHP components yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt 3. Restart Apache and MySQL 4. You can upload PHP files for testing in the default code directory, the default directory is /var/www/html . The path can be modified in the httpd.conf file. *Then, you can configure Apache MySQL PHP according to your specific needs. The default configuration file path is as follows: Apache configuration file path: /etc/httpd/conf/httpd.conf I hope this article will help you maintain your CentOS server. You may also be interested in:
|
<<: More Features of the JavaScript Console
>>: How to make full use of multi-core CPU in node.js
Phenomenon The system could compile the Linux sys...
Table of contents background How to determine whe...
As shown in the figure: But when viewed under IE6...
This article shares the specific code for JavaScr...
Table of contents 1. Installation and operation o...
Table of contents Creating OAuth Apps Get the cod...
1. Add MySQL Yum repository MySQL official websit...
By default, MySQL in Linux distinguishes between ...
In tomcat, jsp is not garbled, but html Chinese i...
Today, when learning PHP, of course, you have to ...
1. Use the shortcut Ctrl + Shift + P to call out ...
Will mysql's IN invalidate the index? Won'...
Installation suggestion : Try not to use .exe for...
Install mysql5.7 under win, for your reference, t...
Copy code The code is as follows: <span style=...