- Joined
- May 6, 2016
- Messages
- 120
- Points
- 18
I have just got a new VPS and I want to install LEMP stack on CentOS 7. Can some of you here share any tips for me to get started?
# Check IPV4
iptables -n -L -v
# Check IPV6
ip6tables -n -L -v
yum update
yum remove httpd
listen 8000;
service httpd restart
yum install mariadb-server mariadb
systemctl enable mariadb
systemctl start mariadb
/usr/bin/mysql_secure_installation
wget nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -i nginx-release-centos-7-0.el7.ngx.noarch.rpm
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
yum install nginx
systemctl enable nginx
service nginx restart
Welcome to nginx!
# You will find the line
server_name localhost;
# And change to:
server_name www.example.com;
# Change the block:
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
# as follows:
index index.html index.htm index.php;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ =404;
}
# Edit the block for php processing as follows:
location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
service nginx restart
yum install php php-mysql php-fpm
cgi.fix_pathinfo=0
# listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock
systemctl enable php-fpm.service
systemctl start php-fpm
systemctl restart httpd
<?php phpinfo(); ?>
http://your-domain.com/info.php
yum install epel-release
yum install phpmyadmin
server {
listen localhost:8000;
server_name localhost;
index index.html index.htm index.php;
root /usr/share/phpMyAdmin;
location / {
try_files $uri $uri/ =404;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# Create a new user
useradd -m test
passwd test
# If you are running Windows, you can use putty for tunnel setup, for example.
# SSH tunnel (replace www.example.com with the correct hostname or IP address)
ssh -fCN [email protected] -L 8000:localhost:8000
# The option of the above command:
# -f: ssh is started as a background process
# -N: no remote command is executed
# -C: Data compression is turned on
# Localhost: 8000: the remote TCP port 8000 is connected to localhost: 8000.
http://www.example.com:8000/phpmyadmin/
http://www.example.com:8000/
[B]## install easyengine[/B]
wget -qO ee rt.cx/ee && bash ee
[B]
## install your LEMP Stack [/B]
ee stack install --web
[B]## create your first website[/B]
ee site create yourdomain.com --**options-you-want**
options available :
--html : simple html website
--php : simple php site
--mysql : mysql + php website
--php7 : to add with mysql to use php7
--letsencrypt : get a free ssl certificate with letsencrypt
--wp : wordpress website
--wpredis : wordpress + redis-server cache
--wpsc : wordpress + wp super cache
--w3tc : wordpress + w3 total cache
ForumWeb.Hosting is a web hosting forum where you’ll find in-depth discussions and resources to help you find the best hosting providers for your websites or how to manage your hosting whether you are new or experienced. You’ll find it all here. With topics ranging from web hosting, internet marketing, search engine optimization, social networking, make money online, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.
The world's smartest hosting providers come here to discuss & share what's trending in the web hosting world!