This is the third day of my participation in Gwen Challenge

preparation

(Install wget, Screen, unzip, create screen session) If it is ali Cloud purchase server these are generally directly available, then we start to implement the items.

If you are running on Ubuntu, you should first update the Ubuntu source before installing lamp

sudo apt-get uodate
Copy the code

Execute the following command after ensuring that the source has been downloaded and installed

yum -y install wget screen git // for CentOS

apt-get -y install wget screen git // for Debian/Ubuntu
Copy the code

After the command is executed, proceed with git Clone lamp and grant the script execution permission

Install the LAMP

Git clone/https://github.com/teddysun/lamp.git/execution git clone CD lamp chmod + x *. Sh / / given executable permissionsCopy the code

Once clone is complete, you can perform the installation operation

screen -S lamp

./lamp.sh
Copy the code

After the previous steps are complete, select and install depending on your requirements or install by default

Apache usually defaults to press enter because the default version is 2.4.29 and it’s a fairly stable version

If your server has less than 1 GB of memory, I recommend that you choose a lower version or you may fail to install mysql. This is a bug in mysql5.6. So I suggest you choose the lower version mysql5.5.58.

Press 1 and enter

And then I’m going to ask you if you want to install the default path and I’m going to choose mine and just press Enter

The next step is to ask you if you want to set your database password.

As a rule of thumb, if your server configuration is low, please choose a lower version, but do not choose a version lower than PHP5.5, because the version below TP5 will not be used, so choose carefully. If your server configuration is slightly lower, please select 5.5. This is a safe operation. After selecting the PHP version, please press Enter to complete the operation. Because there aren’t any holes left down there.

When you see this prompt, you will prove that you have finished selecting, please press Enter to finish!

The lamp installation process takes about 20 minutes, so if you don’t see error at the end of the installation, you’ve installed it successfully!

Lamp operation command:

Using tips

Creating a Virtual Host

lampadd
Copy the code

Deleting a Virtual Host

lamp del
Copy the code

Listing virtual hosts

lamp list
Copy the code

How to upgrade

Note: Do not copy input after the double slash //

git pull                // Get latest version./upgrade.sh            //Selectonetoupgrade./upgrade.sh apache      //UpgradeApache./upgrade.sh db          //UpgradeMySQL/MariaDB/Percona./upgrade.sh php        //UpgradePHP./upgrade.sh phpmyadmin  //UpgradephpMyAdmin
Copy the code

How to uninstall

./uninstall.sh
Copy the code

Application directory

MySQL installation directory: /usr/local/mysql

MySQL database directory: /usr/local/ MySQL /data

MariaDB Installation directory: /usr/local/mariadb

MariaDB database directory: /usr/local/mariadb/data

Percona installation directory: /usr/local/percona

Percona database directory: /usr/local/percona/data

PHP installation directory: /usr/local/php

Apache installation directory: /usr/local/apache

Command to see

MySQL or MariaDB or Percona command

/etc/init.d/mysqld (start|stop|restart|status)
Copy the code

Apache command

/etc/init.d/httpd (start|stop|restart|status)
Copy the code

Memcached command (optional installation)

/etc/init.d/memcached (start|stop|restart|status)
Copy the code

Redis command (optional installation)

/etc/init.d/redis-server (start|stop|restart|status)
Copy the code

Site root

The default site root directory: /data/ WWW /default

The installation of wordpress

Download the official wordpress installation package (cn.wordpress.org/)

Sudo wget HTTP: / / https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gzCopy the code

Unzip the tar.gz package for wordpress (be careful what version you downloaded when unzipping)

Sudo tar ZXVF - wordpress - 4.9 - zh_CN. Tar. GzCopy the code

Move wordpress to /data/ WWW /default, the root of your site

In the browser to http://localhost/wordpress/wp-admin/install.php if successful visit, completing the wordpress environment.

Install FTP (for wODPress updates and theme downloads)

Run the FTP installation command

sudo apt-get install vsftpd      //ubuntu

yum install vsftpd               //centos
Copy the code

Verify that VSFTP is installed


sudo service vsftpd restart        //ubuntu

service vsftpd restart           //centos
Copy the code

After some simple configuration, it’s ready to go!