Hướng dẫn cài đặt và sử dụng EasyEngine 3.5 trên vps ubuntu 16.04 full phpmyadmin – ftp – https
Hướng dẫn cài đặt và sử dụng EasyEngine 3.5 trên vps ubuntu 16.04 full phpmyadmin – ftp – https
Chào các bạn, hôm nay mình hướng dẫn các bạn cài đặt một vps tự động chạy website wordpress dễ dàng, nhanh chóng bằng EasyEngine tất cả trong một từ thiết lập phpmyadmin, tạo tài khoản FTP, cài đặt https cho website wordpress.
Chú ý nhé: Các bạn nên làm chuẩn theo thứ tự tránh xảy ra lỗi. hihi # install EasyinstallEngine
wget -qO ee rt.cx/ee && sudo bash ee # Setup user pass mail defaul for login wordpress
nano /etc/ee/ee.conf
Tìm đến đoạn này và nhập thông tin để đăng nhập website của bạn khi tạo xong
####User name for WordPress sites user =
### Password for WordPress sites password =
EMail for WordPress sites email =
Khi thiết lập xong nhớ lưu lại. Ctrl +x -> y -> Enter # Create and install wordpress on example.com
sudo ee site create example.com –wp # or Create and install wordpress on example.com with plugin w3tc
sudo ee site create example.com –wp –w3tc
============================================================================================================== # Tạo phpMyAdmin # install phpmyadmin
ee stack install –phpmyadmin # Installing Composer
curl -sS https://getcomposer.org/installer | php — –filename=composer –install-dir=/usr/local/bin # Create a subdomain for phpmyadmin
sudo ee site create sub.example.com –wp # Delete db of subdomain site
ee site delete sub.example.com –db # Delete file config subdomain site
cd /var/www/sub.example.com
rm -rf wp-config.php # Delete all file in htdocs subdomain
cd /var/www/sub.example.com/htdocs
rm -rf * # Clone phpmyadmin
git clone https://tuantienle@bitbucket.org/tuantienle/phpmyadmin401020.git # Copy all file to htdocs
cp -r /var/www/sub.example.com/htdocs/phpmyadmin401020/. /var/www/sub.example.com/htdocs # view pass root mysql
cat /etc/mysql/conf.d/my.cnf # Login to root mysql (Ghi nhớ lại pass này nhé)
cd
mysql -u root -p # Change pass root mysql
UPDATE mysql.user SET Password = PASSWORD(‘password in here’) WHERE User = ‘root’;
FLUSH PRIVILEGES; # Update pass for root
nano /etc/mysql/conf.d/my.cnf
Khi sửa lại thành pass bạn vừa đổi thì lưu lại nhé ?
============================================================================================================== # Tạo user sFTP và phân quyền trong server Linux dùng Easy Engine # THIẾT LẬP LẦN ĐẦU # Create Users
useradd -G www-data -ms /bin/false username
passwd username # Create SFtp Home Directory
mkdir -p /home/username/example.com/htdocs # Setup Permissions
chown username:www-data /home/username/example.com
chown root:root /home/username/
chown root:root /home/ # The permissions should look like this for example.com directory, after executing above command.
ls -ld /home/
drwxr-xr-x 5 root root 4096 Oct 24 06:42 /home/
ls -ld /home/username/
drwxr-xr-x 3 root root 4096 Oct 24 06:42 /home/username
ls -ld /home/username/example.com
drwxr-xr-x 2 username www-data 4096 Oct 31 08:49 /home/username/example.com # Setup sftp-server
nano /etc/ssh/sshd_config # Find below line
Subsystem sftp /usr/lib/openssh/sftp-server # Replace above line with following line
Subsystem sftp internal-sftp # Add following lines at after file
Match group www-data X11Forwarding no ChrootDirectory %h AllowTcpForwarding no ForceCommand internal-sftp
# Restart ssh service
systemctl restart sshd.service # Setup webroot permissions
chmod g+s /var/www/example.com/htdocs/ chmod 775 /var/www/example.com/htdocs
# Mount webroot in SFtp home directory
mount –bind /var/www/example.com/htdocs /home/username/example.com/htdocs
# add above command in /etc/rc.local
nano /etc/rc.local
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will “exit 0” on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing.
mount –bind /var/www/example.com/htdocs /home/username/example.com/htdocs
exit 0 ==============================================================================================================
# HTTPS FOR WEBSITE
# install letsencrypt
# Cài plugin simple ssl cho website
# Create new website with letsencrypt
ee site create example.com –wp -w3tc –letsencrypt
# Update website to https
ee site update example.com –letsencryp
Last updated