Ubuntu18.4中Apache在加不同端口的虚拟主机


1.添加监听端口

sudo vim /etc/apache2/ports.conf


Listen 80
Listen 6080

         Listen 443


         Listen 443


2.添加虚拟主机配置

sudo vim /etc/apache2/sites-available/gisas.conf


        #ServerName www.example.com

        ServerAdmin webmaster@localhost
         DocumentRoot /var/www/html

      
                   Options Indexes FollowSymLinks MultiViews
                   AllowOverride None
                   Order allow,deny
                   allow from all
        

        #Rewrite
         RewriteEngine On


         ErrorLog ${APACHE_LOG_DIR}/error-gisas.log
         CustomLog ${APACHE_LOG_DIR}/access-gisas.log combined

        WSGIDaemonProcess gisas user=my group=my threads=5
         WSGIScriptAlias / /var/www/apps/gisas/gisas.wsgi
        
             WSGIProcessGroup gisas
             WSGIApplicationGroup %{GLOBAL}
             Order allow,deny
             Allow from all
        



# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


3.应用虚拟主机配置

sudo a2ensite gisas


4.重启服务

sudo systemctl restart apache2

你可能感兴趣的:(Ubuntu18.4中Apache在加不同端口的虚拟主机)