54324 发表于 2017-9-22 08:58:51

ubuntu apache lamp安装与云盘挂载

挂云盘
# fdisk -l
# mkfs -t ext4 /dev/vdb
#mkdir /disk2
# mount /dev/vdb /disk2
#df -h

#vi/etc/fstab

在最后一行添加

/dev/vdb /disk2 ext4 defaults 0 0

# fdisk -l
# mkfs -t ext4 /dev/vdb
#mkdir /disk2
# mount /dev/vdb /disk2
#df -h

#vi/etc/fstab

在最后一行添加
/disk2/www/xxxCdn
/dev/vdb /disk2 ext4 defaults 0 0

更新源
apt-get update
安装Apache php 和插件
apt-get install apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-intl php-pear php5-mcrypt php5-memcache php5-memcached php5-sqlite php5-tidy php5-xmlrpc php5-ming
apt-get install php5-gd
apt-get install subversion
操作命令
service apache2 restart 开启apache
a2enmod headers 开启模块
a2enmod rewrite 开启模块
service apache2 restart 开启apache
cd /etc/apache2/sites-available/
a2dissite 000-default.conf 清空配置文件
cp 000-default.confxxx.conf 创建配置文件
rm -f xxx.conf 删除创建的配置文件
vi xxx.conf 编辑配置文件
a2ensite xxx.conf 开启配置文件
chmod -R 777 log/ 开启目录权限
配置虚拟主机 样板
<VirtualHost *:80>

    #ServerName
    #ServerAlias cdn.meishikapian.cn
    #ServerAlias www.meishikapian.cn
    ServerAdmin webmaster@localhost

    DocumentRoot /disk2/www/xxx
    ErrorLog /disk2/log/www/xxx/error.log
    CustomLog /disk2/log/www/xxx/access.log combined

    DirectoryIndex index.html index.php
      <Directory /disk2/www/xxx>
               # Options Indexes FollowSymLinks MultiViews
      #      # AllowOverride None
               # AllowOverride All
               # Order allow,deny
               # allow from all
                  Options -Indexes +FollowSymlinks
                  AllowOverride All
                  Require all granted
      </Directory>

</VirtualHost>

虚拟主机
<VirtualHost *:80>

    ServerName qfxtest.api.ping-qu.com
    #ServerAlias cdn.meishikapian.cn
    #ServerAlias www.meishikapian.cn
    ServerAdmin webmaster@localhost

    DocumentRoot /disk2/www/xxx
    ErrorLog /disk2/log/xxx/error.log
    CustomLog /disk2/log/xxx/access.log combined

    DirectoryIndex index.html index.php
      <Directory /disk2/www/xxx>
               # Options Indexes FollowSymLinks MultiViews
      #      # AllowOverride None
               # AllowOverride All
               # Order allow,deny
               # allow from all
                  Options -Indexes +FollowSymlinks
                  AllowOverride All
                  Require all granted
      </Directory>

</VirtualHost>

pperson 发表于 2017-12-30 20:23:28

哈哈哈哈哈哈哈

zhangxiajun 发表于 2018-2-8 08:49:35

给力
页: [1]
查看完整版本: ubuntu apache lamp安装与云盘挂载