CentOS 7系統安裝Ghost

2021-07-12 00:53:05 字數 2816 閱讀 6888

# yum -y update
安裝基本的lamp環境是必須的,lamp是指linux、apache、mariadb、php。

1)安裝apache伺服器

# yum install httpd openssl mod_ssl
重啟apache伺服器

# systemctl enable httpd2)安裝mariadb資料庫

# yum install mariadb mariadb-server mysql
預設情況下,mariadb並不夠安全,故應該修改其預設配置來加固其安全。使用mysql_secure_installation指令碼,並注意以下的步驟細節,比如設定root賬戶的密碼、移除匿名使用者、不允許root賬戶遠端登入、移除test資料庫和時序安全訪問mariadb等。

# mysql_secure_installation
像這樣進行配置:

- set root password? [y/n] y

- remove anonymous users? [y/n] y

- disallow root login remotely? [y/n] y

- remove test database and access to it? [y/n] y

- reload privilege tables now? [y/n] y

# mysql -u root -p
重啟mariadb

# systemctl restart mariadb

# systemctl status mariadb

# systemctl enable mariadb

3)安裝php
# yum install php php-mysql
如果php應用還需要一些擴充套件模組,可以選擇安裝,如下:

php-cli : command-line inte***ce for php

php-common : common files for php

php-devel : files needed for building php extensions

php-fpm : php fastcgi process manager

php-pecl-memcache : extension to work with the memcached caching daemon

php-pgsql : a postgresql database module for php

php-process : modules for php script using system process inte***ces

4)配置防火牆

centos 7的防火牆缺省會阻塞一切,故必須在防火牆允許http/https通過防火牆。執行命令:

# sudo firewall-cmd --reload執行以下命令安裝node.js和npm:

# yum install nodejs npm --enablerepo=epel
驗證安裝是否正確,執行:

# node -v && npm -v

v0.10.26

1.3.6

# mkdir -p /var/www/html

# cd /var/www/html

# curl -l -o

# unzip -d ghost ghost-latest.zip

# cd ghost

# sudo npm install --production

ghost安裝完成後,進行配置並用主機的網域名稱更新配置檔案中的url。

# cp config.example.js config.js
開啟配置檔案:

# nano config.js
找到「production」節,用網域名稱更新url,修改後看起來如下:

// ### production

// when running ghost in the wild, use the production environment.

// configure your url and mail settings here

production: {

url: 'http://your_domain',

至此完成了整個安裝過程,可以啟動ghost了。

# npm start –production
ghost預設在http 80埠下是可用的。所以開啟瀏覽器,訪問http://server-ip:2368,完成剩餘的安裝步驟。如果主機上使用了防火牆,需要允許2368埠通過。

CentOS7系統安裝

centos 7.5 x86 64 開啟vmware主頁點選建立虛擬機器 2 新增映象位置 3 啟動虛擬機器 4 設定網絡卡為eth開頭,centos7預設安裝網絡卡名稱並非以eth開頭 按tab鍵輸入 net.ifnames 0 biosdevname 0 之後回車 5 選擇鍵盤 預設就好,點選c...

CentOS7系統安裝筆記

首先,格式化硬碟。硬碟裡殘留的windows引導資訊和oem資訊會讓你的安裝變成這樣 windows下用ultraiso將映象寫入u盤後安裝程式會莫名找不到映象位置,先用legacy引導,選擇第一項,按tab,把內容改為 vmlinuz initrd initrd.img linux dd quie...

centos7系統安裝Mariadb

從最新版本的centos系統開始,使用命令yum install mysql 預設安裝的是 mariadb而不是mysql!yum install mariadb mariadb server systemctl start mariadb 啟動mariadb systemctl enable ma...