Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile source code and build LAMP environment

2025-03-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to build a LAMP environment for source code compilation. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Actual content: build a virtual host and demonstrate the browsing effects of three different situations

1. Open the virtual host

two。

Method 1: resolve different domain names through different IP addresses

Add IP (the IP resolved by another domain name) to the server.

[root@xuegod60 conf] # ifconfigeth0:1 192.168.10.90 netmask 255.255.255.0 # add an ip

[root@xuegod60 conf] # mkdir-p/var/www/html/bbs # create a bbs directory

[root@xuegod60 conf] # echo "bbs.192.168.10.90" > / var/www/html/bbs/index.html

[root@xuegod60 conf] # ping192.168.10.90

PING 192.168.10.90 (192.168.10.90) 56 (84) bytes of data.

64 bytes from 192.168.10.90:icmp_seq=1 ttl=64 time=0.042 ms

Modify httpd.conf

# vim httpd.conf at the end of the file, add the following

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot/var/www/html/

ServerNamedummy-host.example.com

ErrorLoglogs/dummy-host.example.com-error_log

CustomLoglogs/dummy-host.example.com-access_log common

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot/var/www/html/bbs/

ServerNamedummy-host.example.com

ErrorLoglogs/dummy-host.example.com-error_log

CustomLoglogs/dummy-host.example.com-access_log common

Test:

[root@xuegod60 conf] # service httpd restart

Http://192.168.10.60/

Http://192.168.10.90/

Method 2: through different domain names:

In the domain name management backend, modify the DNS configuration so that www.xuegod.com and bbs.xuegod.com are resolved to the same IP.

Modify httpd.conf

# vim httpd.conf

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot/var/www/html/

ServerName www.xuegod.com

ErrorLog logs/www.xuegod.com-error_log

CustomLog logs/www.xuegod.com-access_logcommon

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot / var/www/html/bbs/

ServerName bbs.xuegod.com

ErrorLog logs/bbs.xuegod.com-error_log

CustomLog logs/bbs.xuegod.com-access_log common

Under windows, the windows hosts file is located at: C:\ Windows\ System32\ drivers\ etc

192.168.10.60 www.xuegod.com

192.168.10.60 bbs.xuegod.com

Test:

[root@xuegod60 conf] # servicehttpd restart

Www.xuegod.com

Bbs.xuegod.com

Method 3: configure the virtual host based on the port:

[root@xuegod60 conf] # vim / etc/httpd/conf/httpd.conf

Add 90 port

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot/var/www/html/

ServerNamewww.example.com

ErrorLoglogs/www.example.com-error_log

CustomLoglogs/www.example.com-access_log common

ServerAdminwebmaster@dummy-host.example.com

DocumentRoot/var/www/html/bbs/

ServerNamebbs.example.com

ErrorLoglogs/bbs.example.com-error_log

CustomLoglogs/bbs.example.com-access_log common

Test:

[root@xuegod60 conf] # service httpd restart

Http://192.168.10.60/

Http://192.168.10.60:90

On how to compile the source code to build the LAMP environment is shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report