一、session貌似沒法設置
<?php
echo ini_get("session.save_path");
echo var_dump(is_writeable(ini_get("session.save_path")));
?>
第一個是返回session路徑,第二個若是返回false表明目錄不存在或者沒有寫入權限
/tmp/phpsession/bool(false)
打開命令行建立目錄:
mkdir -p /tmp/phpsession
賦予目錄www屬性
cd /tmp/phpsession
賦予目錄www屬性
chown -R www:www phpsession
再訪問上面的php文件應該就是true了。
二、mysql啓動報錯
/etc/init.d/mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/alidata/server/mysql/data/AY140409190102955e73Z.pid
http://www.jb51.net/article/48625.htm
參照上面的問題,但我這個問題緣由是log目錄不存在
查看/etc/my.cnf文件,log-error=/alidata/log/mysql/error.log,創建這個目錄並賦予權限就OK了
三、關於阿里雲服務器的安裝參照這個帖子
http://www.cnblogs.com/ada-zheng/p/3724957.html
各個服務操做命令彙總:
nginx:
/etc/init.d/nginx start/stop/restart/reload)
apache:
/etc/init.d/httpd start/stop/restart/...
mysql:
/etc/init.d/mysqld start/stop/restart/...
php-fpm:
/etc/init.d/php-fpm start/stop/restart/...
ftp:
/etc/init.d/vsftpd start/stop/restart/...
好比啓動nginx:
/etc/init.d/nginx start
php.ini的位置/alidata/server/php-5.3.29/etc/php.ini
四、經過端口號訪問phpmyadmin的nginx方法
server {
listen 808;
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/phpmyadmin;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
access_log /alidata/log/nginx/access/phpmyadmin.log;
}
這樣就能夠經過ip訪問phpmyadmin了
五、服務器配置redis
相似mongodb作啓動腳本方法同樣
製做啓動腳本:
1.在/etc/rc.d/init.d/目錄下新建redis文件,將腳本內容【redis】拷貝進去
2.chkconfig --add redis #註冊服務
3.chkconfig --level 345 redis on #指定服務在三、四、5級別運行
4.redis.conf放到redis文件裏面的配置文件位置
腳本用法:
service redis start #啓動6379端口實例的redis
/etc/init.d/redis start #默認啓動6379端口實例的redis
redis腳本:
# description: Start and Stop redis
PATH=/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT=6379
EXEC=/alidata/server/redis-2.8.18/src/redis-server
REDIS_CLI=/alidata/server/redis-2.8.18/src/redis-cli
PIDFILE=/var/run/redis.pid
CONF="/alidata/server/redis-2.8.18/redis.conf"
case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed."
else
echo "Starting Redis server..."
$EXEC $CONF
fi
if [ "$?"="0" ]
then
echo "Redis is running..."
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE exists, process is not running."
else
PID=$(cat $PIDFILE)
echo "Stopping..."
$REDIS_CLI -p $REDISPORT -a $AUTH SHUTDOWN
sleep 2
while [ -x $PIDFILE ]
do
echo "Waiting for Redis to shutdown..."
sleep 1
done
echo "Redis stopped"
fi
;;
restart|force-reload)
${0} stop
${0} start
;;
*)
echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2
exit 1
esacphp