Preliminary preparation:
1. CentOS6.5 virtual system;
2. CentOS6.5 IP address: 192.168.2.99
3. The virtual system can access the external network
Let's start configuring:
Step 1: Installation
First we need to install the Apache httpd server under our CentOS6.5 and enter the command:
yum -y install httpd*, where the -y parameter means that when the installation process prompts you to select Yes or No, all are automatically selected as Yes: * means all files under httpd, as shown below:
Step 2: Configuration
1. After the installation is complete, use service httpd start to start the Apache httpd server. When starting, you will find a prompt message: httpd is starting: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName , as shown in the figure:
2. At this time, you need to modify the configuration file /etc/httpd/conf/httpd.conf. Run the command: vi /etc/httpd/conf/httpd.conf to open the configuration file and find the following content:
#ServerName www.example.com:80
is changed to
ServerName localhost:80
Listen 80 #This indicates that the default port is port 80
3. If the configuration file is modified, you need to restart the Apache httpd server after the modification: service httpd restart, as shown in the figure:
4. The next step is the most important. It depends on whether httpd can run or not. Close the firewall command: service iptables stop #Temporary shutdown, restarting the system will fail. As shown below:
Step 3: Test
1、完成上面的步骤后,接下来就可以测试一下Apache httpd服务器的初步配置是否成功。因为这里配置的是CentOS6.5本地的Apache httpd服务器,所以测试的时候就需要在Windows浏览器下测试一下。
2、打开浏览器,在地址栏输入:http://192.168.2.99 #如果修改了端口就是这样:http://192.168.2.99:端口号
第四步:关闭软件
关闭httpd使用service httpd stop命令
结束,第一次写,大家多包涵