Note content: LNMP environment under CentOS7 to build Dedecms website
Date of Note: 2017-12-03
< br>
Prerequisites for building a Dedecms website:
< br>
ps aux |grep nginx
netstat -lntp |grep nginx
[ root@localhost ~]# getenforce selinux
Disabled
[ root@localhost ~]# iptables -nvL
The commands for opening port 80 and closing selinux are as follows:
[ root@localhost ~]# setenforce 0 #Temporary closure
[ root@localhost ~]# vim /etc/selinux/config #Permanently close SELINUX=Enforcing changed to SELINUX=disabled
[ root@localhost ~]# firewall-cmd --zone=public--add-port=80/tcp --permanent #Open port 80
ps aux |grep php-fpm
[ root@localhost ~]# cd /data/wwwroot/default[root@localhost /data/wwwroot/default]# mv index.html index.php
[ root@localhost /data/wwwroot/default]# vim index.php
The edited content is as follows:
<? php
phpinfo();?>
Then use the browser to visit, and the php configuration information page is displayed, which means it can be parsed normally:
mysql -uroot -p'12345'
< br>
After ensuring that the services in the above LNMP environment are normal, download the compressed package of Dedecms on the official website. The download address of the official website is as follows:
http://www.dedecms.com/products/dedecms/downloads/
What I downloaded here is the UTF8 version of 5.7:
[ root@localhost ~]# cd /usr/local/src/[root@localhost /usr/local/src]# wget http://updatenew.dedecms.com/base-v57/package/DedeCMS-V5.7-UTF8-SP2.tar.gz
After downloading, unzip, you can see the following directories:
[ root@localhost /usr/local/src]# tar -zxvf DedeCMS-V5.7-UTF8-SP2.tar.gz
[ root@localhost /usr/local/src]# ls
DedeCMS-V5.7-UTF8-SP2
[ root@localhost /usr/local/src/DedeCMS-V5.7-UTF8-SP2]# ls
docs uploads
[ root@localhost /usr/local/src/DedeCMS-V5.7-UTF8-SP2]#
< br>
Then configure the MySQL database, create a user and a library for DedeCMS, because it is more dangerous to use the root user directly. Of course, it doesn't matter if you just do experiments, you can ignore the configuration in this step and use the root user directly.
mysql -uroot -p'12345'
CREATE DATABASE dedeCMS;
CREATE USER DedeCMS@localhost IDENTIFIED BY '123456';
If you want to be more secure, you can use MySQL's built-in password function to MD5 encrypt the user's password when creating a user:
CREATE USER DedeCMS@localhost IDENTIFIED BY PASSWORD('123456');
Or further nested encryption:
CREATE USER DedeCMS@localhost IDENTIFIED BY PASSWORD(PASSWORD('123456'));
GRANT ALL ON dedeCMS.* TO DedeCMS;
exit
< br>
First delete the default file in the nginx default site directory, which is the page file we just used to test and parse the php, and then copy all the files in the unzipped uploads directory to the nginx default site directory:
[ root@localhost /usr/local/src/DedeCMS-V5.7-UTF8-SP2]# rm -f /data/wwwroot/default/index.php
[ root@localhost /usr/local/src/DedeCMS-V5.7-UTF8-SP2]# mv ./uploads/* /data/wwwroot/default/
[ root@localhost /usr/local/src/DedeCMS-V5.7-UTF8-SP2]# cd !$
cd /data/wwwroot/default/
[ root@localhost /data/wwwroot/default]# ls
a dede favicon.ico include install member robots.txt tags.php uploads
data images index.php m plus special templets
[ root@localhost /data/wwwroot/default]#
After completing the above operations, use the browser to visit: http://192.168.77.130/install/index.php (change the IP address to your machine's IP address), and then configure Dedecms on the page step by step:
Then the following interface may appear due to insufficient permissions:
In this case, just give permissions to these directories:
[ root@localhost /data/wwwroot/default]# chmod 777 ./[root@localhost /data/wwwroot/default]# chmod 777 a/[root@localhost /data/wwwroot/default]# chmod 777 special/[root@localhost /data/wwwroot/default]# chmod 777 uploads/
Just refresh the page after granting permissions:
Set database information and administrator password:
Website information settings:
The installation is complete:
website homepage:
Visit http://192.168.77.130/dede/ to log in to the background of the website:
< br>
**So far, the construction of DedeCMS is complete. If you want to build a complete website, you need to do a lot of configuration, because everyone’s needs are different, and the specific configuration is based on the template configuration or secondary development according to the needs. This is not an overview, but if you have any questions during the construction process, please send a private message. **
Recommended Posts