This guide assumes that you're developing an app on Arch, not that you're running a server.
If you're looking to run a server on Arch Linux, then you've got bigger problems than this.
Linus Torvalds have mercy on your soul.
$ sudo pacman -S apache php-apache mariadb
$ mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
$ sudo pacman -S composer
- Append following lines to
/etc/httpd/conf/httpd.conf
:
LoadModule php_module modules/libphp.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Note: Make sure you comment out or delete other mpm modules. Otherwise, the Apache server won't start due to module conflicts.
- Also append to
/etc/httpd/conf/httpd.conf
:
<Directory "absolute/path/to/project/root">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
DirectoryIndex index.php
</Directory>
- OPTIONAL: Set global directory index for any Apache server, just in case.
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Creating a user is as simple as:
$ sudo systemctl start mariadb.service
$ mariadb
Then, using basic MySQL:
MariaDB> CREATE USER 'my-cool-user'@'localhost' IDENTIFIED BY 'my-cool-password';
Don't use "my-cool-password".
Instructions on how to get apache-pwd can be found at the original repo.
<sarcasm>
Props to the repo owner, he's such a cool guy! </sarcasm>
Go into your project directory, ./apache-pwd [port]
and see the magic unfold.
Good luck and may your code-nerves be of steel.
When it comes to installing phpMyAdmin, you have two choices:
- The Arch Linux way: cloning the repo. If you're going this route, you probably know how to do it. (repo)
- The Mentally Stable way: Using Composer. This requires you to have installed Composer in Step 1.
For the sake of this gist, we'll go with the Option B.
Go to your project directory and run composer create-project phpmyadmin/phpmyadmin
. This will create a "phpmyadmin" directory in your project root, which you can then access at localhost:[port]/phpmyadmin/
.
Log in with the user you created in Step 3 and have fun!