zoukankan      html  css  js  c++  java
  • 安装apache

    1.安装apache2
    sudo apt-get install apache2

    2.安装php
    sudo apt-get install libapache2-mod-php5
    sudo apt-get install php5

    3.安装sql服务器
    sudo apt-get install mysql-server
    sudo apt-get install php5-mysql

    5.修改web目录权限
    chown -R www-data:www-data /var/www

    6.在/var/www新建目录niot,并将网站内容全部放到此目录

    7.在/etc/apache2/sites-available/目录下建立文件niot.conf,内容如下:
    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
        RewriteEngine On
        RewriteOptions Inherit
        DocumentRoot /var/www/niot
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /var/www/niot>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    8.建立配置文件软链接并删除默认有效配置:
    sudo ln -s /etc/apache2/sites-available/niot.conf /etc/apache2/sites-enabled/niot.conf
    sudo rm /etc/apache2/sites-available/000-default.conf(任何非niot.conf的其他文件)
    9. 使apache支持 rewrite 模块(去掉index.php)
    sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
    10. 添加 rewrite 规则 (网站根目录的 .htaccess 文件)
    RewriteEngine on                                                                                                                
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond $1 !^(index.php|images|robots.txt)
    RewriteRule ^(.*)$ /bill/index.php/$1 [L]

    11.重启apache
    sudo /etc/init.d/apache2 restart

  • 相关阅读:
    money 和 smallmoney
    Sql server decimal 和 numeric
    SQL server数据类型int、bigint、smallint、tinyint
    c# 的传递参数值传递与传递引用的区别,ref与out区别
    释放SQL Server占用的内存
    JavaScript学习总结(一)——JavaScript基础
    js1
    Expected URL scheme 'http' or 'https' but no colon was found
    转载:SpringBoot Process finished with exit code 0
    转载:十大经典排序算法(动图演示)
  • 原文地址:https://www.cnblogs.com/bluewelkin/p/4285259.html
Copyright © 2011-2022 走看看