sh 在Ubuntu 16.04上安装LAMP(Xenial Xerus)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在Ubuntu 16.04上安装LAMP(Xenial Xerus)相关的知识,希望对你有一定的参考价值。

# enable ssl module for apache2
a2enmod ssl

# create symlink to sites-enabled from sites-available
a2ensite default-ssl

# remove symlink from sites-enabled
a2dissite default-ssl

=========

# uncomment in /etc/apache2/apache2.conf
<Directory /srv/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
# vi /etc/php/7.0/apache2/php.ini

upload_max_filesize = 100M
post_max_size = 100M
# /etc/php/7.0/apache2/php.ini

opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=4000
opcache_revalidate_freq = 240

# phpenmod opcache

service apache2 restart
# setup basic firewall UFW
sudo ufw app list
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status

### Mysql
# Step 1: Update your system by typing the following command
sudo apt update
sudo apt dist-upgrade

# Step 2: Install mysql version 5.7 on Ubuntu 16.04
sudo apt install mysql-server

# Step 3: Run mysql_secure_installation to secure your installation
sudo mysql_secure_installation

### Apache
# Step 1: install apache
apt install apache2

# If you look at the Apache Full profile, it should show that it enables traffic to ports 80 and 443:
sudo ufw app info "Apache Full"

# Allow incoming traffic for this profile:
sudo ufw allow in "Apache Full"
sudo ufw allow in "OpenSSH"

# fiing error: apache2: Could not reliably determine the server's fully qualified domain name
touch /etc/apache2/conf-available/servername.conf

# put inside servername.conf
ServerName srv.webium.me

# assuming you called the file added to conf-available on step 1 'servername.conf'
sudo a2enconf servername

# turn on mods for drupal
a2enmod rewrite headers

# install unzip
apt install unzip

service apache2 reload

### PHP
sudo apt install php libapache2-mod-php php-mcrypt php-mysql

# move index.php to the start of line
vi /etc/apache2/mods-enabled/dir.conf

# install required by drupal php modules
apt install php7.0-curl php7.0-xml php7.0-gmp php7.0-gd php7.0-mbstring php7.0-xmlrpc php7.0-zip

# you can search for php modules this way
apt-cache search php7.0 | less

# restart apache2
service apache2 restart

以上是关于sh 在Ubuntu 16.04上安装LAMP(Xenial Xerus)的主要内容,如果未能解决你的问题,请参考以下文章

sh 在Ubuntu 16.04中,Lamp堆栈,sublime,appache2配置更改,wp cli安装,节点安装

在 Ubuntu Server 16.04 LTS 上安装 LAMP

sh 安装node.js版本6.x Ubuntu 16.04

sh 安装node.js版本6.x Ubuntu 16.04

LAMP Droplet Ubuntu 16.04 上的作曲家问题

DigitalOcean 推荐的ubuntu16下LAMP安装过程