Fedora WEB开发环境安装配置

关闭SELinux

$sudo vi /etc/sysconfig/selinux ,更改 SELINUX=disabled

升级包管理工具

$sudo dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate

配置使用 dnf 最快源,开启缓存

$sudo vi /etc/dnf/dnf.conf,添加以下行

fastestmirror=true  
keepcache=true  

(参考:DNF Configuration Reference

安装chromium

$sudo dnf install chromium

生成SSH KEY 并添加至各服务 (Github/coding.net/ ...)

$ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
$clip < ~/.ssh/id_rsa.pub

(参考:Generating an SSH key

安装编辑器 (Visual Studio Code/Atom/sublime text3/...)

安装Nginx

$sudo dnf install nginx
$sudo service nginx start
$firewall-cmd --permanent --add-service=http
$firewall-cmd --permanent --add-service=https
$systemctl reload firewalld

安装MariaDB

$sudo dnf install mariadb-server
$sudo service mariadb start
$mysql_secure_installation

安装PHP和PHP-FPM

$sudo dnf install php php-commom php-fpm php-mysql php-gd
$sudo vi /etc/php-fpm.d/www.conf
//在www.conf文件中做以下配置
//user = nginx 
//group = nginx
$sudo service php-fpm restart
$sudo service nginx restart

安装composer

$php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$php composer-setup.php
$php -r "unlink('composer-setup.php');"
$sudo mv composer.phar /usr/local/bin/composer