現在很多朋友都喜歡租用raksmart VPS,其主要優勢是國內訪問速度快,性能好,而且租用價格也比較便宜。目前RAKsmart提供美國VPS、香港vps和日本VPS等國外VPS產品,而且方案種類比較多,支持Linux和Windows兩種操作系統,適合不同用戶的建站需求。
其中使用RAKsmart linux vps一般都需要安裝Web環境才能搭建網站,常見的像是LAMP、LNMP等環境。本文就給大家介紹下RAKsmart Linux VPS中安裝LAMP環境的操作步驟,僅供大家參考。
實驗環境:
Centos7.1版本
252MB內存
[root@appmoney ~]#
一、配置Apache環境
1、安裝Apache
[root@appmoney ~]# yum install httpd httpd-devel
2、啟動Apache
[root@appmoney ~]# systemctl start httpd
3、設置httpd服務開機啟動
[root@appmoney ~]# systemctl enable httpd
4、查看狀態
[root@appmoney ~]# systemctl status httpd
5、防火墻設置開啟80端口
[root@appmoney ~]# firewall-cmd –permanent –zone=public –add-service=http
success
[root@appmoney ~]# firewall-cmd –permanent –zone=public –add-service=https
success
[root@appmoney ~]# firewall-cmd –reload
success
6、瀏覽器登陸
訪問IP地址(獨立IP),出現以下界面說明安裝成功:
二、MySQL環境配置
1、安裝MySQL
[root@appmoney ~]# yum install mariadb mariadb-server mariadb-libs mariadb-devel
[root@appmoney ~]# rpm -qa |grep maria
2、開啟MySQL服務,并設置開機啟動和檢查狀態
[root@appmoney ~]# systemctl start mariadb
[root@appmoney ~]# systemctl enable mariadb
[root@appmoney ~]# systemctl status mariadb
[root@appmoney ~]# netstat -tulp
3、數據庫安全設置
[root@appmoney ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS script IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the currentpassword for the root user. If you’ve just installed MariaDB, andyou haven’t set the root password yet, the password will be blank,so you should just press enter here.
Enter current password for root (enter for none):OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.
Set root password? [Y/n] yNew password:Re-enter new password:Password updated successfully!Reloading privilege tables..… Success!
By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.
Remove anonymous users? [Y/n] y… Success!
Normally, root should only be allowed to connect from ‘localhost’. Thisensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n… skipping.
By default, MariaDB comes with a database named ‘test’ that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.
Remove test database and access to it? [Y/n] y– Dropping test database…… Success!– Removing privileges on test database…… Success!
Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.
Reload privilege tables now? [Y/n] y… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MariaDBinstallation should now be secure.
Thanks for using MariaDB!
4、登陸MySQL數據庫測試
[root@appmoney ~]# mysql -uroot -p
三、PHP環境配置
1、安裝PHP
[root@appmoney ~]# yum -y install php
[root@appmoney ~]# rpm -ql php
2、將PHP與MySQL關聯起來
[root@appmoney ~]# yum install php-mysql
[root@appmoney ~]# rpm -ql php-mysql
3、安裝常用PHP模塊
[root@appmoney ~]# yum install -y php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-bcmath
4、測試PHP
[root@appmoney ~]# cd /var/www/html/
[root@appmoney html]# ls
[root@appmoney html]# vi info.php
<?phpphpinfo();?>~~:wq
5、重啟Apache服務器
[root@appmoney ~]# systemctl restart http
6、在電腦瀏覽器輸入 IP/info.php,觀察能否看到已經安裝的模塊。
以上就是這次RAKsmart Linux VPS安裝LAMP環境教程,安裝完成后就可以安裝WordPress等各種程序了。
相關推薦:《RAKsmart VPS主機控制面板SolusVM使用介紹》
本文由 貴州做網站公司 整理發布,部分圖文來源于互聯網,如有侵權,請聯系我們刪除,謝謝!
c語言中正確的字符常量是用一對單引號將一個字符括起表示合法的字符常量。例如‘a’。數值包括整型、浮點型。整型可用十進制,八進制,十六進制。八進制前面要加0,后面...
2022年天津專場考試原定于3月19日舉行,受疫情影響確定延期,但目前延期后的考試時間推遲。 符合報名條件的考生,須在規定時間登錄招考資訊網(www.zha...
:喜歡聽,樂意看。指很受歡迎?!巴卣官Y料”喜聞樂見:[ xǐ wén lè jiàn ]詳細解釋1. 【解釋】:喜歡聽,樂意看。指很受歡迎。2. 【示例】:這是...
地量是什么意思?地量是股票的成交量處于較低的水平,判斷放量與縮量則看k線圖的紅綠色柱子,通過換手率,過量比還有成交量指標來看。地量在股票之中就是相對成交比較低的一種狀態,也是一種對比值,是相對于高位的天量來說,一旦是成交量到達頂端成交量的20%,也就進入到了地量的狀態。在一定的情況之下,股票的成交量出現明顯的下跌也就證明了不夠活躍,成交持續下跌,最終就會進入到地量狀態。漲停之后,買出單減少買入單增...
疫情補助金怎么領取?1、用戶打開第三方支付平臺;2、進入第三方支付平臺界面后點擊市民中心;3、在市民中心界面點擊社保;4、在公共服務選項點擊全國失業金申領;5、點擊失業金待遇領取;6、點擊失業補助金領取條件后面的去領取;7、在界面勾選接收條款,并點擊同意;8、在界面核對社保銀行賬戶信息,并點擊提交申請。待社保局審核通過后,會將失業補助金劃撥到用戶的社保銀行賬戶。2022年疫情補貼領取條件及標準20...
【資料圖】哈嘍小伙伴們 ,今天給大家科普一個小知識。在日常生活中我們或多或少的都會接觸到明朝有朱歷這個皇帝嗎方面的一些說法,有的小伙伴還不是很了解,今天就給大家詳細的介紹一下關于明朝有朱歷這個皇帝嗎的相關內容。明朝皇帝:明太祖朱元璋、明惠帝朱允炆、明成祖朱棣、明仁宗朱高熾、明宣宗朱瞻基、明英宗朱祁鎮、明代宗朱祁鈺、明憲宗朱見深 、明孝宗朱佑樘、明武宗朱厚照、明世宗朱厚熜、明穆宗朱載垕、明神宗朱翊鈞...