最简配置 app 升级服务器

1. ubuntu 服务器安装 apache 服务器软件:

sudo apt-get install apache2

2. 配置 apache 服务器:

cd /etc/apache2/sites-available

sudo cp 000-default.conf appserv.conf

sudo vim appserv.conf

注意红色字体修改;

<VirtualHost *:8010>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/appserv
    <Directory /var/www/html/appserv>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

3. 创建 link 文件:

sudo ln -s /etc/apache2/sites-available/appserv.conf /etc/apache2/sites-enabled/appserv.conf

或者使用a2ensite 命令启用虚拟主机
sudo a2ensite appserv

4. 修改 ports.conf 允许 apache 监听8010端口:

sudo vim /etc/apache2/ports.conf

添加 Listen 8010

5. 重启apache 服务器
sudo /etc/init.d/apache2 restart

然后在浏览器访问:

http://192.168.1.250:8010/

Reference:

Ubuntu上安装Apache,每次重启,都会出现以下错误提示:
Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
解决方法:
http://blog.csdn.net/klinghr/article/details/5378271

 



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值