hhvm 安装

https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM

Fedora 20安装
https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Fedora-20

回到顶部制作

JS


      $(document).ready(function(){ 
        $("#backtop").hide(); 
        $(window).scroll(function () { 
          if ($(this).scrollTop() > 100) { 
            $('#backtop').fadeIn(); 
          } else { 
            $('#backtop').fadeOut(); 
          } 
        }); 
        $('#backtop').click(function () { 
          $('body,html').animate({ 
            scrollTop: 0 
          }, 500); 
        }); 
        $("pre").addClass("prettyprint"); 
        prettyPrint(); 
        $("a.menu").click(function(){
            $("#main-header").toggleClass("nav-res");
        });
      }); 

HTML

回到顶部

CSS

#backtop {
    background: url("images/backtop.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
    bottom: 80px;
    cursor: pointer;
    height: 36px;
    position: fixed;
    right: 55px;
    width: 36px;
}

图片:
backtop

Fedora 安装Drupal 7出现files目录无权限

在安装Drupal 7时,竟然出现了Files目录无权限。但是我已经将我的files改成了 777(环境LAMP)
我的www目录是 /home/zhouitpro/d7
接着我在index.php 直接运行 mkdir(“./hello”); 也报了一个错误. 说没有权限

Warning: mkdir(): Permission denied

找到这里有一个解决办法: http://stackoverflow.com/questions/13908722/php-unable-to-create-a-directory-with-mkdir
应该是SELinux内容要重新设置一下类型

sudo chcon -R -t httpd_sys_content_rw_t /home/zhouitpro/www/

设置以后正学工作了

解决shadowsocks 连Centos 6 Google无法搜索

我安装了shadowsocks去连到我的Centos服务器,其它网站能正常使用。但是当我使用Google搜索的时候却无法正常使用。

We're sorry...

... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.
See Google Help for more information.

Google + shadowsocks

解决办法
1. 禁用服务器的IPv6 功能

#vim /etc/sysconfig/network

找到

NETWORKING_IPV6="yes"

替换成, 如果上面的没有找到则可以直接将以下代码加在末尾

NETWORKING_IPV6="no"

2. 修改/etc/hosts,把ipv6的那句本地主机名解析的也注释掉:

#::1   localhost localhost6 localhost6.localdomain6

Fedora mysql修改DataDir以后无法启动

错误信息

Redirecting to /bin/systemctl restart  mysqld.service
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.

调试方法1, 使用mysql_install_db. 这样会报出很多错误信息

sudo mysql_install_db --user=mysql --datadir=/home/zhouitpro/mysql

调试试方法2, 检测

#/usr/libexec/mysqld --skip-grant --general-log &
[1] 13171
bash-4.2$ 140515 11:59:27 InnoDB: The InnoDB memory heap is disabled
140515 11:59:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140515 11:59:27 InnoDB: Compressed tables use zlib 1.2.8
140515 11:59:27 InnoDB: Using Linux native AIO
140515 11:59:27 InnoDB: Initializing buffer pool, size = 128.0M
140515 11:59:27 InnoDB: Completed initialization of buffer pool
140515 11:59:28 InnoDB: highest supported file format is Barracuda.
140515 11:59:30  InnoDB: Waiting for the background threads to start
140515 11:59:31 Percona XtraDB (http://www.percona.com) 5.5.37-MariaDB-34.0 started; log sequence number 20660071321
140515 11:59:31 [Note] Plugin 'FEEDBACK' is disabled.
140515 11:59:31 [Note] Server socket created on IP: '0.0.0.0'.
140515 11:59:31 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 13)
140515 11:59:31 [ERROR] Can't start server: can't create PID file: Permission denied

错误大概出来了, 我没有权限.

chmod 777 /var/run/mariadb/
 setenforce 0 

Fedora 安装LAMP

User IS: zhouitpro
Document root: /home/zhouitpro/www
MYSQL: /home/zhouitpro/mysql

1. Install LAMP

yum install mysql mysql-server httpd php php-gd php-pdo php-mbstring php-mysql
systemctl enable httpd.service
systemctl start httpd.service

2. Change Mysql Data DIR:

#chown mysql:mysql /home/zhouitpro/mysql
#vim /etc/my.cnf

修改

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysqld]
datadir=/home/zhouitpro/mysql
socket=/home/zhouitpro/mysql/mysql.sock


Save and close this file.
Step 2: Changing permission

# chmod 711 /home/user1
# chmod -R 755 /home/user1/web

This step is necessary since in fedora, httpd process will be executed by user ‘apache’, thus permission need to be change.
By default, the permission for each user directory is drwx——, so that other users can’t access to files in this directory and its subdirectories.

# setsebool -P httpd_enable_homedirs 1
# chcon -R -t httpd_sys_content_t /home/user1/web

Note: httpd by default is not allowed to access users home directories, see this page
Step 3: Restart apache

# service httpd restart

Hope this may help some new-bee a little bit 🙂
N.B. This is a draft post published today. Right now I am using Fedora 19 and This process works like charm here.