1.應用場景
快速查詢linux命令.
2.學習/操作
// 命令大全查詢
// linux命令大全(手冊)
1.centos //centos 6/7均可使用命令
1.檢視web伺服器版本
apache:
httpd -v 或者 apachectl -v
安裝目錄:
尋找安裝目錄: tbd
2. 啟動/停止/重啟apache服務, 已經開機啟動
前提:apache安裝成為linux的服務[什麼時候不是服務 ?tbd]
方式一:
使用 systemctl start/restart/stop httpd.service ,如下
systemctl enable httpd.service //開機啟動
systemctl status httpd.service //檢視執行狀態
以上本質是在執行:
/bin/systemctl status httpd.service //檢視執行狀態資訊
備註:linux 服務管理兩種方式service和systemctl
systemctl不只是對apache, 如redis或者firewall等服務都是進行管理的。
如關閉/開啟/檢視防火牆[狀態]:
備註:如果開啟了防火牆和selinux,web伺服器是不能對外提供服務的,即被阻隔了服務。
現在關閉防火牆和selinux
部落格:正常訪問
詳情見:
方式二:
service httpd start 啟動
service httpd restart 重新啟動
service httpd stop 停止服務
備註:具體如何使用httpd -h命令, 另行查詢資料
linux httpd命令是apache http伺服器程式。
httpd為apache http伺服器程式。直接執行程式可啟動伺服器的服務。
2. nginx:
tbd3. 檢視php版本
php -v 或者 php --version
4. 檢視mysql版本
mysql -v 或者 mysql --version
或者進入mysql, 執行sql: select version();
5. [進入]apache web根目錄
cd /usr/local/apache/htdocs
後續補充
1.1 centos 6
tbd1.2 cents 7
tbd2.ubuntu lts/8.04 lts / 19.10 均可使用
方式一:
啟動apache服務
# /etc/init.d/apache2 start
or$ sudo /etc/init.d/apache2 start
//重啟apache服務
# /etc/init.d/apache2 restart
or$ sudo /etc/init.d/apache2 restart
//停止apache服務
# /etc/init.d/apache2 stop
or$ sudo /etc/init.d/apache2 stop
後續補充
2.1 ubuntu 16.04 lts
tbd2.2 ubuntu 18.04 lts
tbd2.3 ubuntu 19.10
tbd2.4 ubuntu 20.04
tbd後續補充
3.問題/補充
tbd4.參考
//ubuntu官網
//centos官網
//阿里映象
//華為映象
//linux系列之常用運維命令整理筆錄
//linux 命令大全
//linux操作彙總
//linux 服務管理兩種方式service和systemctl
//lamp
後續補充
Linux命令收集
df h 統計檔案系統容量 du sm sort n 統計當前目錄大小,並按大小排序 檔案複製命令cp 命令格式 cp adfilprsu 原始檔 source 目標檔案 destination cp option source1 source2 source3 directory 引數說明 a 是...
linux 命令收集
1.不顯示 etc services 開頭的行,etc services檔案並沒有修改 sed e d etc services more 2.忽略前十行,顯示後面的內容 sed e 1,10d etc services more 3.列印所有包括begin的行和end行之間的行的內容 sed n ...
linux命令收集 1
1 mysql的命令 關閉資料庫 bin mysqladmin shutdown uroot 啟動資料庫 nohup bin mysqld safe cmd.log 2 1 0 刪除資料庫 mysqladmin u username p password drop database 建立資料庫 my...