Ways to add ports to Apache virtual hosts _linux

Source: Internet
Author: User

Find your Apache installation directory, find the httpd.conf file,
Search #listen This sentence, add below

Copy Code code as follows:
Listen 800
Listen 801
Listen 802


Here is the test, you can according to your need to add different listening port, OK, the Apache web port is open, we have to configure the virtual host.

Found it

Copy Code code as follows:

#<virtualhost *:80>
# serveradmin Webmaster@dummy-host2.phps Tutorial hao.cublog.cn
# Documentroot/www/docs/dummy-host2.phps Tutorial hao.cublog.cn
# servername dummy-host2.phpshao.cublog.cn
# errorlog Logs/dummy-host2.phpshao.cublog.cn-error_log
# Customlog Logs/dummy-host2.phpshao.cublog.cn-access_log Common
#</virtualhost>

Type this code, because the installation directory is different, there will be a small difference, we directly search <virtualhost *:80> also line, and then add the following

Copy Code code as follows:
<virtualhost 192.168.0.110:802>//802 is our increased listening web port
ServerAdmin qq@sina.com
DocumentRoot d:/www/www.php100.com/
ServerName www.php100.com
Errorlog Logs/dummy-host2.phpshao.cublog.cn-error_log
Customlog Logs/dummy-host2.phpshao.cublog.cn-access_log Common
</virtualhost>

The last step is to get Apache back on the OK

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.