ubuntu apache2 多域名

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuzhong8809/article/details/78009937

linode

add a new linode

sudo apt-get update  // apt-get install 前 update

sudo apt-get install apache2 


绑定域名

1 vim  /ect/apache2/apache.conf

添加行:

<Directory /srv/www/>

        Options Indexes FollowSymLinks

        AllowOverride None

        Require all granted

</Directory>


(注:缺这一步,浏览器访问报错:

Forbidden

You don't have permission to access / on this server.


cd /srv

mkdir www

cd www

mkdir  exaple.com

cd exaple.com

mkdir public.html

mkdir logs

vim index.html


3 cd /etc/apache2/sites-avaible

vim example.com.conf

<VirtualHost *:80>

     ServerAdmin [email protected]

     ServerName example.org

     ServerAlias www.example.org

     DocumentRoot /srv/www/example.org/public_html/

     ErrorLog /srv/www/example.org/logs/error.log

     CustomLog /srv/www/example.org/logs/access.log combined

</VirtualHost>


sudo /etc/init.d/apache2 restart


再用浏览器访问 example.org 就可以看到页面。



猜你喜欢

转载自blog.csdn.net/wuzhong8809/article/details/78009937
今日推荐