Fedora 20安装MySQL启动报错

报错:
Failed to issue method call: Unit mysql.service failed to load: No such file or directory.

解决方法:
systemctl status mysqld.service

systemctl enable mysqld.service
That enables starting on reboot. (You don’t HAVE to do that.)

systemctl start mysqld.service

Ubuntu编译PHP报错

WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4 (found: 3.0)

解决方法:
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb
dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb
dpkg -i bison_2.7.1.dfsg-1_amd64.deb

SSH代理设置

服务端设置:
groupadd groupname
useradd -d /home/username -m -g groupname -s /bin/false username
passwd username

本机启动代理:
Linux:
ssh -N -D 7070 username@123.123.123.123
将 Socks 代理的服务器 IP 地址设为 127.0.0.1,并且端口为 7070

Windows + PuTTY:
Connection->SSH->Tunnels
Source port输入7070,勾选Dynamic,点Add,登陆即可。注意要用能登陆shell的账户,不能是上面创建的那个账户。

Fedora 23/22/21/20常用工具

安装 yum 自动选择最快源插件:
sudo yum install yum-plugin-fastestmirror

添加RPMFusion源:
20/21:
sudo yum localinstall --nogpgcheck http://mirrors.aliyun.com/rpmfusion/free/fedora/rpmfusion-free-release-stable.noarch.rpm
sudo yum localinstall --nogpgcheck http://mirrors.aliyun.com/rpmfusion/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
22:
sudo rpm -Uhv http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm
sudo rpm -Uhv http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-22.noarch.rpm

安装Remi源:
sudo rpm -Uhv http://rpms.famillecollet.com/fedora/remi-release-23.rpm

让归档管理器支持RAR、7Z:
sudo yum install unrar p7zip
# KDE 环境下需要使用命令行解压 rar 文件,命令:unrar x xxx.rar 路径
# 如果路径留空则解压到当前目录

动态内核模块支持:
sudo yum install dkms

内核头文件:
sudo yum install kernel-devel

编译器:
sudo yum install gcc gcc-c++ cmake

安装 OpenCV:
sudo yum install opencv opencv-devel

其他 lib:
sudo yum install cups-devel

文本比对工具:
sudo yum install meld

Git:
sudo yum install git
配置 Git 用户信息:
$ git config --global user.name "yannanfei"
$ git config --global user.email xx@xx.com

FTP 客户端:
sudo yum install filezilla

下载工具:
DownThemAll(Firefox 插件)

gnome-tweak-tool 设置工具:
sudo yum install gnome-tweak-tool

chm阅读器:
sudo yum install kchmviewer

截屏工具:
sudo yum install shutter
安装完毕之后可以设置快捷键快速启动

屏幕录像工具:
sudo yum install byzanz
使用方法:
byzanz-record -d 40 -x 0 -y 0 -w 400 -h 320 byzanz-demo.gif
其中:
-d 40 为录制的时长为 40 秒
-x 0 录制区域的横坐标
-y 0 录制区域的纵坐标,记住:屏幕右上角为原点(0,0)
-w 400 录制区域的宽度
-h 320 录制区域的高度

词典:
sudo yum install goldendict
词库下载地址:http://abloz.com/huzheng/stardict-dic/

SQLite 管理工具:
sudo yum install sqliteman

播放器:
sudo yum install vlc

清理旧内核:
sudo package-cleanup --oldkernels

清除缓存目录(/var/cache/yum)下的软件包:
sudo yum clean packages

清除缓存目录(/var/cache/yum)下的 headers:
sudo yum clean headers

清除缓存目录(/var/cache/yum)下旧的 headers:
sudo yum clean oldheaders

清除全部:
sudo yum clean all

Fedora 21/20 x64 或 openSUSE 13.2/13.1 KDE x64 安装QQ 2013

下载Longene QQ 2013,地址:http://www.longene.org/forum/viewtopic.php?f=6&t=4700

解压deb文件,赋予777权限,将opt和usr目录中的文件拷贝到系统对应位置。

双击应用程序中的QQ图标,或者直接在命令行执行qq2013。

Feodra:
sudo yum install libstdc++.so.6 gtk2.i686 cups-libs.i686
sudo yum install glibc.i686 libpng12.i686 libXext.i686
sudo yum install alsa-plugins-pulseaudio.i686 gtk+-devel.i686 lcms2-devel.i686 libSM.i686 ncurses-* ncurses-libs.i686 mesa-libGL-devel.i686
sudo yum install mesa-dri-drivers.i686

openSUSE:
sudo zypper install libstdc++.so.6 gtk2-32bit cups-libs-32bit
sudo zypper install glibc-32bit libpng12-0-32bit
sudo zypper install alsa* ncurses-* libgthread-2_0-0-32bit

Fedora 20配置JDK

下载 jdk 并解压
sudo chmod -R 777 '/home/li/jdk1.7.0'

sudo vi /etc/profile
在倒数第三行加入:
export JAVA_HOME=/home/li/jdk1.7.0
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
保存

source /etc/profile

java -version

Fedora 20/21/22/23/25 安装PHP环境

安装yum插件:
sudo yum install yum-plugin-fastestmirror

配置防火墙:
sudo systemctl enable firewalld
sudo systemctl start firewalld
设置规则:
sudo firewall-cmd --set-default-zone=public
编辑开启的服务:
vi /etc/firewalld/zones/public.xml
或者
sudo firewall-cmd --permanent --zone=public --add-service=http
如果是开发环境可以禁止ssh登录:
sudo firewall-cmd --permanent --zone=public --remove-service=ssh
重载firewalld配置:
sudo firewall-cmd --reload
查看当前开通的服务:
sudo firewall-cmd --zone=public --list-services
或者端口:
sudo firewall-cmd --zone=public --list-ports

关闭SELinux:
sudo vi /etc/sysconfig/selinux
SELINUX=disabled

安装Remi源:
sudo rpm -Uhv http://rpms.famillecollet.com/fedora/remi-release-23.rpm

安装 Nginx + PHP-fpm,可参考 CentOS 7 安装 Nginx + PHP
安装完毕需要修改:
sudo vi /etc/nginx/conf.d/php-fpm.conf
server unix:/var/run/php-fpm/php-fpm.sock;
sudo vi /etc/php-fpm.d/www.conf
listen.mode = 0666

安装Apache + PHP:
sudo yum install httpd
sudo systemctl enable httpd.service
sudo systemctl start httpd.service
测试:http://localhost
sudo yum install php php-devel
sudo systemctl restart httpd.service
sudo vi /var/www/html/info.php
输入:
<?php
phpinfo();
?>
测试:http://localhost/info.php
安装MySQL:
默认安装的是MariaDB,需要替换为MySQL的要先去 http://dev.mysql.com/downloads/repo/yum/ 下载安装 repository provides
sudo yum install mysql mysql-server
sudo systemctl enable mysqld
sudo systemctl start mysqld
mysql_secure_installation
设置时区:
vi /etc/my.cnf 在 [mysqld] 节点添加:
default-time_zone = '+8:00'

如果在线安装下载速度太慢,可以去 http://repo.mysql.com/yum/mysql-5.7-community/fc/25/x86_64/ 用下载工具直接下载rpm文件进行安装
下载
mysql-community-server-5.7.16-1.fc25.x86_64.rpm
mysql-community-client-5.7.16-1.fc25.x86_64.rpm
mysql-community-common-5.7.16-1.fc25.x86_64.rpm
mysql-community-libs-5.7.16-1.fc25.x86_64.rpm
mysql-community-embedded-5.7.16-1.fc25.x86_64.rpm
mysql-community-embedded-compat-5.7.16-1.fc25.x86_64.rpm
安装:
yum install mecab-devel mecab-ipadic
rpm -Uvh --force --nodeps /home/li/下载/mysql-community-common-5.7.16-1.fc25.x86_64.rpm
rpm -Uvh --force --nodeps /home/li/下载/mysql-community-libs-5.7.16-1.fc25.x86_64.rpm
rpm -Uvh --force --nodeps /home/li/下载/mysql-community-client-5.7.16-1.fc25.x86_64.rpm
rpm -Uvh --force --nodeps /home/li/下载/mysql-community-embedded-5.7.16-1.fc25.x86_64.rpm
rpm -Uvh /home/li/下载/mysql-community-embedded-compat-5.7.16-1.fc25.x86_64.rpm
rpm -Uvh /home/li/下载/mysql-community-server-5.7.16-1.fc25.x86_64.rpm

如需管理工具,可以安装
yum install mysql-workbench

设置PHP环境:
sudo vi /etc/php.ini
date.timezone = PRC
display_errors = On

安装PHP模块:
sudo yum install php-bcmath php-gd libjpeg* php-intl php-ldap php-mysqlnd php-mbstring php-mcrypt php-mhash php-odbc php-pdo php-pear pcre-devel php-pecl-memcache php-pecl-zendopcache php-pecl-xdebug php-soap php-xml php-xmlrpc
修改xdebug参数:
sudo vi /etc/php.d/xdebug.ini
xdebug.remote_enable=on
xdebug.idekey="PHPSTORM"
;xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
;需要多客户端调试的话请开启remote_connect_back
;xdebug.remote_connect_back=1
;xdebug.profiler_enable=0
;xdebug.profiler_output_dir=/tmp/xdebug_profiler
;xdebug.trace_format = 0
;xdebug.overload_var_dump = 0

注:
如果无法远程调试,请先web方式查看phpinfo检查xdebug设置是否生效,
如已生效,则使用telnet访问phpinfo中的remote ip的9000端口,如果无法访问,则说明有网络问题或者防火墙设置问题

禁用 eval 语句:
到 http://rpmfind.net/linux/rpm2html/search.php?query=php-suhosin 下载安装 RPM 文件
sudo vi /etc/php.d/40-suhosin.ini
suhosin.executor.disable_eval = On

sudo systemctl restart httpd
or
sudo systemctl restart php-fpm
sudo systemctl restart nginx

安装Memcache:
sudo yum install memcached
sudo systemctl start memcached
sudo systemctl enable memcached

fedora 20安装virtualbox

这里不使用yum安装vbox,因为不是最新版;
从vbox官方网站下载最新版的vbox,双击rpm安装,然后启动一台虚拟机会发现无法启动,
需要这样做:

yum -y install dkms gcc make kernel-devel

/etc/init.d/vboxdrv setup

OK

USB支持:
先安装插件,之后执行:
sudo usermod -a -G vboxusers 用户名