Setup Apache2 in Debian 9 and enable the ports for the sites

Source: Internet
Author: User

[Email protected]:~# apt-get Install apache2

[Email protected]:~# cd/etc/apache2/

[Email protected]:/etc/apache2# ls-l

Total 80
-rw-r--r--1 root root 7224 June 15:29 apache2.conf
Drwxr-xr-x 2 root root 4096 Jul 8 12:06 conf-available
Drwxr-xr-x 2 root root 4096 Jul 8 12:06 conf-enabled
-rw-r--r--1 root root 1782 June 15:25 Envvars
-rw-r--r--1 root root 31063 Jan 16:16 Magic
Drwxr-xr-x 2 root root 12288 Jul 10:05 mods-available
Drwxr-xr-x 2 root root 4096 Jul 10:05 mods-enabled
-rw-r--r--1 root root 332 Jul 8 11:40 ports.conf
Drwxr-xr-x 2 root root 4096 Jul 10:21 sites-available
Drwxr-xr-x 2 root root 4096 Jul 10:14 sites-enabled

[Email protected]:/etc/apache2# VI ports.conf


Listen 80
Listen 8080

<ifmodule ssl_module>

[Email protected]:/etc/apache2# cd sites-enabled/

[Email protected]:/etc/apache2/sites-enabled# cp 000-default.conf 001-default.conf

[Email protected]:/etc/apache2/sites-enabled# VI 001-default.conf

<virtualhost *:8080>

Documentroot/var/www/mysite

[Email protected]:/etc/apache2/sites-enabled# apachectl-k Restart

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now, we have both site could be accessed. http://127.0.0.1, http://127.0.0.1: 8080

Setup Apache2 in Debian 9 and enable the ports for the sites

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.