刘德华属什么生肖| 前列腺炎吃什么药最有效| 频繁流鼻血是什么病的前兆| 庄子是什么学派| 孢子是什么| 早博是什么| 犯口舌是什么意思| 不知道自己适合什么工作| 二月十九是什么星座| 苍鹰是什么意思| o型血孩子父母是什么血型| 滇红属于什么茶| 胆码是什么意思| 什么动物怕水| 胆囊炎有什么症状| 内射什么感觉| vad是什么意思| 异曲同工是什么意思| longines是什么牌子| 草字头占读什么| 神经衰弱挂什么科| 总流口水是什么原因| 咽峡炎吃什么药| ym是什么衣服品牌| 不是什么| 一什么不什么| 支气管炎吃什么消炎药| 吃红枣有什么好处和坏处| 气管炎吃什么食物好| 慈禧和溥仪是什么关系| 人突然消瘦是什么原因| 孕激素高会有什么影响| 意大利面是用什么做的| 欧皇是什么意思| 清宫是什么意思| 甲亢去医院挂什么科| 燕麦片热量高为什么还能减肥| 什么体质容易怀双胞胎| 人脱水了会有什么表现| igg是什么| 单核细胞偏高说明什么| 咽喉干燥是什么原因| 左眼皮一直跳是什么原因| 为什么容易被蚊子咬| 饕餮是什么意思| 9号来的月经什么时候是排卵期| 为什么香蕉不能放冰箱| 胃糜烂可以吃什么水果| 3月27日什么星座| 请丧假需要什么证明| 脚真菌感染用什么药| 从此萧郎是路人是什么意思| 至加秦是什么字| 一月二十三号是什么星座| foreverlove是什么意思| 焦虑挂什么科| 梦见偷别人东西是什么意思| 血脂高吃什么水果最好| 为什么长湿疹| 红细胞压积偏低是什么意思| 胃幽门螺旋杆菌吃什么药| air是什么牌子的鞋| 血脂看什么指标| 孕妇吃什么好| 绿色加蓝色是什么颜色| 全血检查能查些什么病| 身上长癣是什么原因| 周杰伦为什么叫周董| 飘零是什么意思| 春天的雨是什么| 晶莹的近义词是什么| 情不自禁的禁是什么意思| 猫的祖先是什么动物| bambi什么意思| 亲亲抱抱举高高什么意思| 520是什么日子| 彩虹代表什么生肖| 松针泡水喝有什么功效| 新生儿为什么会有黄疸| 督导是什么| 9.10是什么星座| 吃什么对甲状腺有好处| 经常性头疼是什么原因| 杜甫是什么朝代的| 尿碘是检查什么的| 脂肪肝适合吃什么食物| 石女是什么意思啊| 什么是pid| 牛肉和什么菜包饺子好吃| 冠心病喝什么茶最好| 康斯坦丁是什么意思| 单亲家庭是什么意思| 抛砖引玉是什么生肖| 口腔溃疡用什么药最好| 康养中心是做什么的| 抗环瓜氨酸肽抗体高是什么意思| 草字头一个辛读什么| 颈椎病用什么枕头好| 艾滋病人有什么特征| 女生左手中指戴戒指什么意思| 9月是什么星座的| 手机为什么突然关机| 女生读什么技校好| 胃酸过多吃什么药| 基点是什么意思| 村里入党需要什么条件| 长疖子是什么原因| 南辕北辙告诉我们什么道理| 儿童包皮挂什么科| 爻辞是什么意思| 降血压吃什么| 水由什么组成| 5.13是什么星座| kbs是什么意思| 肾阴虚吃什么食物最好| 食管息肉的症状是什么| 指甲竖纹是什么原因| 放下是什么意思| 四川有什么市| 矿泉水敷脸有什么作用| 甲状腺结节忌口什么| 仪轨是什么意思| 焕字五行属什么| 胃烧心吃什么能缓解| 拉肚子吃什么药好| 闪购是什么| labs是什么意思| 怀孕是什么感觉| 保育是什么意思| 女累读什么| 六个月宝宝可以吃什么水果| 月经不调是什么症状| 小儿病毒性感冒吃什么药效果好| 反应性细胞改变是什么意思| 赤小豆和红豆有什么区别| 小白龙叫什么| 九知道指的是什么| 乌龟下蛋预示着什么| 小孩脚后跟疼是什么原因| 请婚假需要什么材料| 子宫下垂是什么症状| 桑榆是什么意思| 杜牧号什么| 枸杞配什么壮阳| 二十二岁属什么| 眼睛充血什么原因| 石头记为什么叫红楼梦| 横纹肌溶解什么意思| 倒霉是什么意思| 什么可以吃| 精神洁癖是什么意思| 抽脂手术对身体有什么副作用| 感冒没胃口吃什么好| imax是什么意思| 捞佬是什么意思| 春节在什么时候| baumwolle是什么面料| 什么是双| 骨痂是什么意思| 嘴巴干苦是什么原因| 电轴不偏是什么意思| 69年出生属什么| 痔疮吃什么| 为什么会脑梗| 霉菌性阴道炎是什么症状| 戴珍珠手链有什么好处| 渠道医院是什么意思| 脚后跟麻木是什么原因| 肖战什么星座| fnh是什么病| 二郎神是什么动物| 甲状腺结节不能吃什么| 西铁城是什么档次的表| 私处变黑是什么原因| 先兆临产是什么意思| 弓形虫是什么| n0是什么意思| 孩子咳嗽吃什么药| 为什么尿是红色的| 大连有什么好吃的| 什么都不是| 二杠四星是什么军衔| 梦见烙饼是什么意思| 闰年是什么| 颈椎病看什么科最好| 尿路感染吃什么药效果好| 得令是什么意思| 痛风吃什么蔬菜| 血糖高会出现什么症状| 榴莲蜜什么味道| 一个井一个点念什么| 小孩手指头脱皮是什么原因| 为什么熊猫是国宝| 补液是什么意思| 格林是什么意思| 瞑眩反应是什么意思| 眼底筛查是检查什么| 漠河什么时候可以看到极光| 心脏彩超fs是什么意思| 俗不可耐是什么意思| 血稠是什么原因造成的| 蛤蚧是什么动物| 隆鼻后吃什么消肿快| 海鲜菇不能和什么一起吃| 毕加索全名是什么| 蔻驰和古驰有什么区别| 喝雄黄酒是什么节日| 一什么绳子| 速度是70迈心情是自由自在什么歌| 心脏早搏是什么症状| 96年是什么年| 青黛是什么意思| 挛缩是什么意思| 升天是什么意思| 心脏逆钟向转位是什么意思| 口炎念什么| 三七植物长什么样子| 阿咖酚散是什么| 肠炎吃什么药| 原则上是什么意思| 宫颈ca什么意思| 酒店尾房是什么意思| 舌尖溃疡是什么原因| 胆固醇高吃什么可以降下来| 秋老虎是什么意思| 抑郁症去医院挂什么科| 吃羊肉不能吃什么东西| 呼吸短促是什么原因| 是什么字| 尿液白细胞高是什么原因| 女人脚腿肿是什么原因| 雯五行属什么| ahc属于什么档次| 偷什么东西不犯法| 面料支数是什么意思| 梦到自己老公出轨是什么意思| 这是什么石头| 中性人是什么意思| 叶酸片什么时候吃| 司令是什么军衔| ada是什么意思| 五行白色属什么| 宝宝热疹用什么药膏| 感冒发烧吃点什么食物比较好| 美国为什么打伊朗| 什么孩子命里有文曲星| 稀料是什么| 什么情况需要根管治疗| 锦纶是什么| 鸿运当头是什么意思| 黄瓜和什么一起炒好吃| 女生下面流水是什么原因| 淹死是什么感觉| 雪纺是什么面料| 心肌缺血什么症状| 肌酸激酶高是什么意思| 耵聍是什么东西| 陪衬是什么意思| 岚的意思是什么| 心慌是什么感觉| 生殖感染用什么消炎药效果好| 肺看什么科室| 子宫肌腺症是什么病| 身上痒是什么情况| 百度

活动预告!重庆第五届"爱在公租房"社区邻里节

Due to its Rolling Release model which embraces cutting-edge software Arch Linux was not designed and developed to run as a server to provide reliable network services because it requires extra time for maintenance, constant upgrades, and sensible file configurations.

But, still, because Arch Linux comes with a core installation with minimal software pre-installed, it can represent a solid base start-up point to install most of the popular network services these days, including LEMP or LAMP, Apache Web Server, Nginx, PHP, SQL databases, Samba, FTP servers, BIND and others, many of them being provided from Arch Linux official repositories and others from AUR.

This tutorial will guide?installing and configuring the?LEMP?stack (Nginx,?PHP,?MySQL?with?MariaDB?engine and?PhpMyAdmin) remotely using SSH, which can provide a strong foundation to build Web Server Applications.

Step 1: Assign a Static IP Address to Arch Linux Network Interface

1. After minimal Arch Linux core installation reboot your server, log in with the root account or equivalent administrative sudo account, and identify your system NIC device names using ip link command.

ip link
Check Arch Linux Network Link
Check Arch Linux Network Link

2. To assign static network configurations we are going to use the netctl package to manage network connections. After you have successfully identified your Network Interfaces names copy the ethernet-static file template to the netctl system path and change its name to a descriptive naming scheme ( try to use the “static” string combined with NIC’s name), by issuing the following command.

sudo pacman -S netctl
sudo cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-profile

3. The next step is to edit this new template file by changing the file’s directives and providing your actual network settings (Interface, IP/Netmask, Gateway, Broadcast, DNS) like in the below excerpt.

sudo nano /etc/netctl/my-static-profile
Set Static IP Address in Arch Linux
Set Static IP Address in Arch Linux

Modify the file with your network settings:

Description='A basic static ethernet connection'
Interface=eth0  # Replace with your network interface name
Connection=ethernet
IP=static
Address=('192.168.1.100/24')  # Replace with your desired IP address
Gateway='192.168.1.1'         # Replace with your gateway address
DNS=('192.168.1.1')           # Replace with your DNS server, if needed

4. The next step is to start your network connection through the netctl system tool and verify your system connectivity by issuing the following commands.

sudo netctl start my-static-profile
sudo netctl status my-static-profile

5. If you get an active green exit status you have successfully configured your Network Interface and it’s time to automatically enable it on system-wide services.

sudo netctl enable my-static-profile

Also test your network by running a ping command against a domain name and also, install the net-tools package (the most well-known feature of this package is ifconfig command which Arch developers considered to be kind of deprecated and replaced with iproute2).

sudo pacman -S net-tools

6. Now you can run the ifconfig command to verify your Network Interfaces settings and check if everything is correctly displayed, then reboot your system to make sure everything is in place and properly configured.

ifconfig
ping tecmint.com
Confirm Network Connection
Confirm Network Connection

Step 2: Install LEMP Software on Arch Linux

As pointed out in this article’s introduction LEMP stands for Linux, Nginx, PHP/PhpMyAdmin, and MySQL/MariaDB which is one of the most widely spread web application platforms today after LAMP (the same stack with Apache in equation).

7. Before installing the LEMP stack we need to update the system and then gain remote control to the Arch Linux server. As you probably know OpenSSH is the main candidate for this job so go ahead and install it, start SSH daemon, and enable it system-wide.

sudo pacman -Syu
sudo pacman -S openssh
Install OpenSSH in Arch Linux
Install OpenSSH in Arch Linux
sudo systemctl start sshd
sudo systemctl status sshd
sudo systemctl enable sshd
Start Open SSH Service
Start Open SSH Service

Now is the time to proceed with LEMP installation. Because this tutorial is meant to be a comprehensive guide I will divide LEMP stack installation into small pieces, step by step.

8. First install the Nginx Web Server, then start it and verify its status by issuing the following commands.

sudo pacman -S nginx
sudo systemctl start nginx
sudo systemctl status nginx
Install Nginx in Arch Linux
Install Nginx in Arch Linux
Start Nginx in Arch Linux
Start Nginx in Arch Linux

9. The next service to be installed is the MySQL database. Issue the following command to install the MySQL database server and choose the MariaDB engine, then start and verify the daemon status.

sudo pacman -S mysql
sudo systemctl start mysqld
sudo systemctl status mysqld
Install MySQL in Arch Linux
Install MySQL in Arch Linux

10. The next step is to provide a highly safe environment for MySQL databases by providing a password for the MySQL root account, removing an anonymous user account, remove the test database and root accounts that are accessible from outside localhost.

Run the following command to improve MySQL security, press [Enter] for the current root account password, then answer Yes to all questions ( also set up your root account password).

sudo mysql_secure_installation
Secure MySQL in Arch Linux
Secure MySQL in Arch Linux

Note: By any means do not confuse MySQL root account with Linux system root account – they are two different things – not so different but they run on different levels.

To verify MySQL security login into the database using mysql -u root -p command syntax, provide your root password then leave the database with exit; command.

mysql -u root -p
Connect MySQL in Arch Linux
Connect MySQL in Arch Linux

11. Now it’s time to install PHP server-side scripting language to be able to develop and run complex dynamic web applications, not just serve HTML/CSS code.

Because we are using Nginx as a web server we need to install a PHP-FPM-backed?module to communicate through Fast Common Gateway and change dynamic content generated by PHP scripts.

Issue the following command line to install the PHP-FPM service, then start the daemon and verify the status.

sudo pacman -S php php-fpm
sudo systemctl start php-fpm
sudo systemctl status php-fpm
sudo systemctl enable php-fpm
Install PHP in Arch Linux
Install PHP in Arch Linux
Start PHP in Arch Linux
Start PHP in Arch Linux

To list all available PHP module issues the following commands.

sudo pacman -Ss | grep php
List PHP in Arch Linux
List PHP in Arch Linux

12. One of the last steps is to install the PhpMyAdmin Web Interface for the MySQL database. Issue the following command to install PhpMyAdmin along with its PHP-needed module then create a symbolic link for the PhpMyaAdmin system path to the Nginx default root path.

sudo pacman -S phpmyadmin
sudo ln -s /usr/share/webapps/phpMyAdmin  /usr/share/nginx/html
Install PhpMyAdmin in Arch Linux
Install PhpMyAdmin in Arch Linux

13. Then configure the php.ini file to include the necessary extensions needed by the PhpMyAdmin application.

sudo nano /etc/php/php.ini

Locate with [CTRL+W] keys and uncomment (remove ; at the line beginning) the following lines.

extension=mysqli.so
extension=mysqli
mysqli.allow_local_infile = On

On the same file locate and edit open_basedir directive to resemble the following included directories.

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/

14. The next step is to enable PHP-FPM FastCGI on the localhost Nginx directive. Issue the next command to backup nginx.conf web server file configuration then replace it with the following content.

sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
sudo nano /etc/nginx/nginx.conf

Add the whole following content on nginx.conf.

#user html;
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  65;
    gzip  on;

    server {
        listen       80;
        server_name  localhost;
        root         /usr/share/nginx/html;
        charset      koi8-r;

        location / {
            index  index.php index.html index.htm;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
        }

        location /phpmyadmin {
            rewrite ^/* /phpMyAdmin last;
        }

        error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        location ~ \.php$ {
            #fastcgi_pass 127.0.0.1:9000; (depending on your php-fpm socket configuration)
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

        location ~ /\.ht {
            deny  all;
        }
    }
}

15. After all file configurations have been made, all you need to do is to restart Nginx and PHP-FPM services and point your browser to http://localhost/phpmyadmin URL from local node or http://arch_IP/phpmyadmin form another computer.

sudo systemctl restart php-fpm
sudo systemctl restart nginx
Check Nginx in Arch Linux
Check Nginx in Arch Linux
Check PhpMyAdmin in Arch Linux
Check PhpMyAdmin in Arch Linux

16. If everything runs as intended the final step is to enable LEMP system-wide with the following commands.

sudo systemctl enable php-fpm
sudo systemctl enable nginx
sudo systemctl enable mysqld

Congratulations! You have installed and configured LEMP on Arch Linux and, now, you have a full dynamic interface to begin and develop web applications.

Although Arch Linux is not the most very-best suited system to run on production servers due to its community-orientated rolling release model it can be a very fast and reliable source for small non-critical production environments.

💡 Want to Level Up Your Linux Skills?

Check out Pro.Tecmint.com for ad-free reading, exclusive guides, downloadable resources, and certification prep (RHCSA, RHCE, LFCS) - all with lifetime access.

Matei Cezar
I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

5 Comments

Leave a Reply
  1. This is a whopping tutorial. I love it!!
    But one problem mcrypt is now an AUR package. Even worse, it doesn’t quite work. MyPhpAdmin is broken somehow. Probably because it needs that package to work. I don’t know specifically what to do. Otherwise this tutorial is brilliant!

    Reply
  2. hi ,
    Thank u for the awesome tutorial.

    I wud like to suggest a small change:
    mysql.so is deprecated now so can u change it to pdo_mysql.so

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

肚脐眼上面痛是什么原因引起的 非甾体抗炎药是什么意思 重庆的市花是什么 什么是相位 夏天种什么水果
coupon什么意思 心跳过快吃什么药 男孩流鼻血是什么原因 经常呛咳是什么病的征兆 吃得苦中苦方为人上人是什么意思
摊手是什么意思 定义是什么 什么是铅 apc药片是什么药 3.2号是什么星座
烂好人是什么意思 扁桃体长什么样 市委书记是什么级别 2006属什么生肖 左旋延胡索乙素是什么
什么是辐射youbangsi.com 杞菊地黄丸治什么病hcv8jop7ns1r.cn 山珍海味是什么意思xinjiangjialails.com 影子虫咬伤后用什么药hcv9jop4ns1r.cn 男人射精快吃什么药hcv7jop7ns0r.cn
帕金森吃什么药最好bfb118.com 炖牛肉放什么调料最好hcv8jop8ns7r.cn 何五行属什么hcv9jop4ns4r.cn 人参什么时候吃最好hcv8jop3ns1r.cn 曾孙是什么意思hcv8jop2ns6r.cn
鸦片鱼是什么鱼96micro.com 扁导体发炎吃什么药gysmod.com 性早熟有什么症状hcv9jop6ns2r.cn 大乔叫什么hcv7jop6ns2r.cn 后背长痘痘是什么原因引起的hcv8jop9ns5r.cn
水土不服是什么意思hcv8jop1ns9r.cn 孩子高低肩有什么好办法纠正hcv9jop2ns0r.cn 吃洋葱对身体有什么好处yanzhenzixun.com 浑身酸疼是什么原因hcv8jop5ns3r.cn 蜂蜜有什么好处hcv7jop5ns3r.cn
百度