Run the following command to install Apache2: run yum-yinstallhttpd. after you press enter, yum will prompt the httpd version that has been installed and update it automatically. if not, the httpd version is automatically installed. Note that enter Y During yum installation to confirm installation. After installing Apache, start it manually... run the following command to install Apache2: run yum-y install httpd. after you press enter, yum will prompt the currently installed httpd version and update it automatically. if not, it will be automatically installed. Note that "Y" is entered during the yum installation process to confirm the installation. After Apache is installed, manually start Apache2:/etc/init. d/httpd start and enter the server IP address in the browser to view the default page of Apache2. At this time, Apache can only provide HTTP services, and cannot execute php or connect to the MySQL database. Install MySQL because CentOS already contains MySQL. Therefore, you only need to run yum: yum-y install mysql-server to start the MySQL service by running the following command:/etc/init. d/mysqld start install php5 run the following command to install php5: yum install php after installing php5, you must restart Apache for php to take effect:/etc/init. d/httpd restart. Apache can parse and execute the php script. Because the default Apache website root directory is located at:/var/www/html/, an info. php file is created in this directory to test whether Apache + PHP is correctly installed or not: vi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service