Centos開發環境LAMP部署

2021-10-03 02:26:20 字數 856 閱讀 1193

lamp 是 linux、apache、mysql 和 php 的縮寫,在生產環境中,lamp是linux伺服器系統必備的伺服器軟體工具。

我的作業系統是centos7, 下面介紹在centos系統安裝lamp的詳細過程:

1.安裝php服務

# yum install php php-fpm php-mysql -y (php-fpm:fastcgi程序管理器)

2.安裝apache服務

# yum install httpd(預設配置路徑:/etc/httpd/conf/httpd.conf,預設訪問路徑:/var/www/html/)

# service httpd start (啟動apache)

# chkconfig mysqld on (設定開機啟動)

3.安裝mysql服務

3.1 只需要安裝mysql客戶端

# yum install mysql  -y

# mysql -h192.168.1.100 -uroot -p1234 (假設mysql服務端ip:192.168.1.100 root使用者密碼:1234)

3.2 安裝mysql-server及mysql-client, 本機yum源中已有mysql-server安裝包(如果沒有跳到3.3)        

# yum install mysql-server -y     

# /usr/bin/mysqladmin -u root password 'new-password' (修改root登入密碼)

# mysql -uroot -pnew-password (用新密碼登入)

# chkconfig mysqld on 

接下來的操作請參考操作這篇博文:

CentOS 配置LAMP環境

方式1.yun 安裝 安裝軟體 以foo x.x.x.rpm為例 yum install foo x.x.x.rpm yum常用命令 yum常用命令 刪除軟體 yum remove foo x.x.x.rpm或者yum erase foo x.x.x.rpm 公升級軟體 yum upgrade fo...

CentOS搭建LAMP環境

1.搭建 mysql 資料庫 安裝 mysql 使用yum安裝 mysql yum install mysql server y安裝完成後,啟動 mysql 服務 service mysqld restart設定 mysql 賬戶 root 密碼 usr bin mysqladmin u root ...

Centos 搭建LAMP環境

1.安裝apache systemctl start httpd.service 啟動apache systemctl stop httpd.service 停止apache systemctl restart httpd.service 重啟apache systemctl enable http...