首先安裝LAMP環境,包括了Apache, MySQL和PHP。這里面還有可道雲作為可選項目。
CentOS7上的安裝命令,現在暫時不支持CentOS8.
yum -y install wget screen git git clone https://github.com/teddysun/lamp.git cd lamp chmod 755 *.sh screen -S lamp ./lamp.sh
安裝wordpress或相關的網站軟件,目標文件夾為 /data/www/default
先在 /data/www/創建個文件夾並解壓軟件
tar -xvf file.tar //解壓 tar包 tar -xzvf file.tar.gz //解壓tar.gz tar -xjvf file.tar.bz2 //解壓 tar.bz2 tar -xZvf file.tar.Z //解壓tar.Z unrar e file.rar //解壓rar unzip file.zip //解壓zip
更改用戶和用戶組,並賦予相關權限
[root@localhost www]# chown -R apache:apache /data/www/wordpress/ [root@localhost www]# chmod -R 755 /data/www//wordpress/
然后將文件夾移動到/data/www/default
[root@localhost www]# mv ./wordpress/ ./default/
最后登錄主頁,通常是192.168.x.x/wordpress。然后會引導到安裝界面