ubuntu apache lamp安装与云盘挂载

前端之家收集整理的这篇文章主要介绍了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.conf xxx.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>

原文链接:https://www.f2er.com/ubuntu/351194.html

猜你在找的Ubuntu相关文章