lamp環境搭建,Discuz、wordpress、Ecshop安裝。

linux環境安裝與論壇搭建php

1.基礎操做
groupadd hehe
useradd zzw -g hehe
passwd zzw
123456html

useradd hehecici
passwd hehecici
123456mysql

cd /root
mkdir -p hehe/haha
ls
cd hehe/haha
touch a.txt
vim a.txt
aaaaalinux

touch b.txt
vim b.txt
bbbbbweb

chown root:hehe a.txt
chown zzw:hehe b.txt
chmod 631 a.txt
chmod 000 b.txt
cp b.txt c.txt
pwd
llsql

2.ftp
groupadd hehe
useradd -g hehe zzw
echo 「123456」 |passwd --stdin zzw
useradd hehecici
echo 「123456」 |passwd --stdin hehecici
mkdir -p /root/hehe/haha
cd /root/hehe/haha
echo aaaaa > a.txt
echo bbbbb > b.txt
chown root:hehe a.txt
chown zzw:hehe b.txt
chmod 631 a.txt
chmod 000 b.txt
cp b.txt c.txt
————————————————
systemctl stop firewalld.service
setenforce 0
yum -y install vsftpd
service vsftpd start或systemctl start vsftpd.service
useradd -M -d /root/hehe/haha -s /sbin/nologin neo
passwd neo
123456數據庫

vim /etc/pam.d/vsftpd
所有註釋掉
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwd
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser_passwdvim

vim /etc/vsftpd/vuser_passwd.txt
zzw
123456
hehecici
123456php7

cd /etc/vsftpd/
db_load -T -t hash -f vuser_passwd.txt vuser_passwd.db
mkdir vuser_conf
cd vuser_conf/app

vim zzw
local_root=/root/hehe/haha
anon_umask=022
write_enable=YES
anon_upload_enable=YES
anon_world_readable_only=NO
download_enable=NO

vim hehecici
local_root=/root/hehe/haha
write_enable=YES
anon_umask=022
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES

vim /etc/vsftpd/vsftpd.conf
guest_enable=YES
guest_username=neo
user_config_dir=/etc/vsftpd/vuser_conf
allow_writeable_chroot=YES

cd /root/hehe/
chown -R neo:neo haha/
chmod -R 775 haha/
service vsftpd restart
根目錄下:chmod -R 777 /root/hehe/haha
帳號在根目錄下新建文件。
echo aaaaa > g.txt
echo aaaaa > e.txt

yum -y install ftp
ftp 私網ip或127.0.0.1
put *.txt
get *.txt

  1. SMB安裝配置
    安裝samba,設置共享目錄爲/root/hehe/haha,要求hehecici帳號可以上傳下載文件,本身名字首字母帳號只能上傳,不能下載
    yum -y install samba-client
    yum -y install samba
    systemctl start smb

vim /etc/samba/smb.conf #配置文件
[haha]
path = /root/hehe/haha
valid users=hehecici,zzw
writable=yes
write list =hehecici,zzw

#爲系統用戶添加爲smb用戶
#Samba用戶的密碼與系統用戶的密碼沒有任何關係
smbpasswd -a zzw
123456
smbpasswd -a hehecici
123456

pdbedit -L #顯示目前系統中已經存在的全部Samba用戶
groupadd zzwa
usermod -g zzwa zzw
chown -R hehecici:zzwa /root/hehe/haha/
chmod -R 733 /root
ls -l /root/hehe/haha/
systemctl restart smb

smb訪問測試
smbclient -L IP //列出全部共享目錄

smbclient //127.0.0.1/haha -U hehecici%123456
smbclient //127.0.0.1/haha -U zzw%123456

get
put

(徹底卸載
PHPhttps://www.cnblogs.com/sunshine-H/p/8117105.html?tdsourcetag=s_pcqq_aiomsg)

3.lamp環境安裝
https://blog.csdn.net/qq_30118843/article/details/82291869?tdsourcetag=s_pcqq_aiomsg

Xftp 6安裝
安裝包存放路徑:/var/www/html

(1) Discuz 安裝
lamp環境安裝
https://blog.csdn.net/qq_30118843/article/details/82291869?tdsourcetag=s_pcqq_aiomsg
安裝zip解壓工具:yum install zip unzip
解壓:unzip Discuz.zip
返回上級:cd …
給權限:chmod -R 777 html

輸入公網:39.106.230.101
密碼設定:admin

刪除目錄:rm -rf html
mkdir html

(3)wordpress安裝
lamp環境安裝
https://blog.csdn.net/qq_30118843/article/details/82291869?tdsourcetag=s_pcqq_aiomsg(安裝除PHP外的全部)
在三個啓動前安裝php7
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum makecache
yum -y install php70w* --skip-broken
service httpd restart
php –v
(以後按照網頁啓動)

安裝zip解壓工具:yum install zip unzip
cd /var/www/html
解壓:unzip wordpress.zip
返回上級:cd …
給權限:chmod -R 777 html
Html下:cp wp-config-sample.php wp-config.php

修改配置文件:vim wp-config.php
define( ‘DB_NAME’, ‘wordpress’ );

/** MySQL database username */
define( ‘DB_USER’, ‘root’ );

/** MySQL database password */
define( ‘DB_PASSWORD’, ‘root’ );

根目錄下,進入數據庫:mysql -u root –p
密碼:root
create database wordpress;
show databases;
安裝時打勾,帳號密碼都admin。

(2)Ecshop安裝
yum -y install httpd
yum -y install unzip zip
yum -y install lrzsz
yum -y install php
yum -y install php-mysql
yum -y install mysql
yum -y install mariadb-devel
yum -y install mariadb-server

vim /etc/php.ini
date.timezone = Asia/Shanghai

systemctl start httpd
systemctl start mariadb
cd /var/www/html/
ls

unzip ECshop_v3.6.0_UTF8_release.zip ls mv ECshop_v3.6.0_UTF8_release/ecshop/ ./ mv ECshop_v3.6.0_UTF8_release/appserver/ ./ chmod -R 777 ecshop/ chmod -R 777 appserver/ mysqladmin -uroot password或mysqladmin -uroot -proot cp -R ecshop/* ./ mv appserver/ …/ www目錄下給權限:chmod -R 777 html