您尚未登录。

楼主 #1 2018-05-25 09:08:32

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Ubuntu apache 网页服务器新建一个 AI 虚拟主机

参考链接: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04

sudo apt-get install -y php5-cli apache2 php5-cgi php5-curl

sudo apt-get install -y libapache2-mod-php5

sudo a2enmod php5

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/ai.whycan.cn.conf

修改 /etc/apache2/sites-available/ai.whycan.cn.conf 文件内容:

<VirtualHost *:80>
    ServerAdmin admin@whycan.cn
    ServerName ai.whycan.cn
    ServerAlias ai2.whycan.cn
    DocumentRoot /var/www/ai.whycan.cn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

sudo a2ensite ai.whycan.cn.conf

service apache2 reload





离线

楼主 #2 2018-05-25 11:27:48

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: Ubuntu apache 网页服务器新建一个 AI 虚拟主机

开启url重写:

sudo a2enmod rewrite

修改配置文件: /etc/apache2/sites-available/ai.whycan.cn.conf

<VirtualHost *:80>
    ServerAdmin admin@whycan.cn
    ServerName localhost
    ServerAlias ai2.whycan.cn
    DocumentRoot /var/www/ai.whycan.cn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^/index.html /tts_test1.php
</VirtualHost>





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn