個人覺得阿里云自帶的控制臺命令行真心不好用,還是習(xí)慣mac自帶的終端
用終端連接阿里云服務(wù)器方法:
#ssh yourName@yourServerIp //其中yourName指服務(wù)器登錄用戶名 yourServerIp指服務(wù)器地址
回車,輸入服務(wù)器密碼,不出意外已經(jīng)連上了你的服務(wù)器,接下來為所欲為吧。
Apache安裝
yum install httpd
啟動
systemctl start httpd.service #啟動
systemctl stop httpd.service #停止
systemctl restart httpd.service #重啟
第二、設(shè)置開機啟動/關(guān)閉
systemctl enable httpd.service #開機啟動
systemctl disable httpd.service #開機不啟動
第三、檢查httpd狀態(tài)
systemctl status httpd.service
關(guān)閉防火墻
關(guān)閉:systemctl stop firewalld.service
查看狀態(tài):systemctl status firewalld.service
PHP安裝
yum -y install php
php各項服務(wù)安裝:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql
MariaDB數(shù)據(jù)庫操作命令
安裝:yum -y install mariadb-server mariadb-client
啟動:systemctl start mariadb.service
停止:systemctl stop mariadb.service
查看狀態(tài):systemctl status mariadb.service
開機啟動:systemctl enable mariadb.service
重啟:systemctl restart mariadb.service
經(jīng)過一番掙扎,決定使用xampp,但是也有問題,在剛更新完服務(wù)器文件之后,會有緩存,打開頁面會是之前的,所以需要重啟一下服務(wù):
/opt/lampp/lampp restart
單獨操作MySQL:
1、進入mysql
XAMPP中的命令工具在/opt/lampp/bin/目錄中,運行mysql命令
/opt/lampp/bin/mysql -uroot -p
2、停止mysql服務(wù)器
sudo /opt/lampp/lampp stopmysql
3、啟動mysql服務(wù)器
sudo /opt/lampp/lampp startmysql