Author Archives: xcl

How to Install JAVA 8 (JDK/JRE 8u131) on Debian 8 & 7 via PPA

Install Java 8 on Debian 8 And 7. The first Oracle Java 8 stable version was released on Mar 18, 2014 and available to download and install. Oracle Java PPA for Debian systems is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates. Ubuntu and LinuxMint users use below link to install Java 8 on their system.

How to Install Java 8 on Ubuntu & LinuxMint
How to Install Java 8 on CentOS, RHEL & Fedora
This article will help you to Upgrade/Install Java 8 on Debian 8/7 system using PPA or Apt-Get command line package manager.

1. Add Java 8 PPA

First, you need to add webupd8team Java PPA repository in your system. Edit a new PPA file /etc/apt/sources.list.d/java-8-debian.list in text editor

$ sudo vim /etc/apt/sources.list.d/java-8-debian.list
and add following content in it.

deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
Now import GPG key on your system for validating packages before installing them.

$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys EEA14886
2. Install Java 8 on Debian

Now use the following commands to update apt cache and then install Java 8 on your Debian system.

$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
3. Verify Java Version

Finally, you have successfully installed Oracle Java on your Debian system. Let’s use the following command to verify installed version of Java on your system.

rahul@tecadmin:~$ java -version

java version “1.8.0_131″
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
4. Configure Java Environment

In Webupd8 PPA repository also providing a package to set environment variables, Install this package using the following command.

$ sudo apt-get install oracle-java8-set-default
References:

https://launchpad.net/~webupd8team/+archive/java

From : https://tecadmin.net/install-java-8-on-debian/

 

WordPress安装主题和插件显示“无法创建目录”解决方法

安装主题需要使用ftp进行上传,所以首先需要检查服务器是否安装了ftp。如果没有安装,需要先安装ftp。这里使用vsftpd举例,ftp用户直接使用root。

1、安装vsftpd:

启用root的使用权限

将这个文件内的root删除

设置ftp为可写入状态

将其中的write_enable=YES,保存重启vsftpd服务

2、设置WordPress目录为可写

进入WordPress网站所在目录,修改themes/plugins两个文件夹权限

重启服务器,此时已经可以正常上传目录和主题

解决WordPress设置错误的url网站不能访问的问题

通过WordPress后台首选项更改了网站url地址之后,网站就会出现访问不了的情况,一般来说,网站后台也登陆不上去了,我从网上寻找到了四种方法,这四种方法前三种都是需要登陆到后台的,但实际上出错后,都不能登陆后台了,没法登陆后台进行调整!所以我用了第四种方法,通过修改数据库里面的内容修改成功!

第一种、修改wp-config.php

1、在wp-config.php中,添加以下两行内容:
define(‘WP_HOME’,’http://www.yourdomain.com’);
define(‘WP_SITEURL’,’http://www.yourdomain.com’);

www.yourdomain.com代表你的新地址

2、登录后台,在 “常规 -> 设置”重新配置新博客地址(HOME)和安装地址(SITEURL),成功后一定记得删除上面添加的内容。

第二种、修改functions.php

functions.php指的是位于当前博客主题目录内,可以自定义一些主题函数。

1、在functions.php中,添加以下两行内容:

update_option(’siteurl’,’http://www.yourdomain.com’);
update_option(‘home’,’http://www.yourdomain.com’);

同样,www.yourdomain.com代表你的新地址

2、登录后台,在 “常规 -> 设置”重新配置新博客地址(HOME)和安装地址(SITEURL),成功后一定记得删除上面添加的内容。

第三种、修改wp-config.php(自动更新地址)

1、在wp-config.php中,添加下面一行内容:
define(‘RELOCATE’,true);

2、登录后台地址,WP将自动更新安装地址(SITEURL),手动修改博客地址(HOME)地址即可,成功后一定记得删除上面添加的内容。

第四种、修改数据库

1,登录到你的管理页面,找到 wp_options

2,将表中的 siteurlhome 字段修改为当前的新域名

具体的sql为: UPDATE wp_options SET option_value=replace(option_value,’http://错误的url’,’http://正确的url’) WHERE option_name=’home’ OR option_name=’siteurl';如果不行,可以执行一下commit;注意sql中的字符格式和语句后面的分号。

这次问题修正,就是采用了这种方法,完美解决WordPress设置错误的域名后出现的访问问题。

 

本文原地址:http://qitiancom.com/archives/1099

Make a simple LAMP on debian for Wheezy quickly

1, sudo apt-get install vsftpd

sudo vim /etc/vsftpd.conf

Uncomment the two sentences:

#local_enable=YES

#write_enalbe=YES

2, sudo apt-get install wordpress curl apache2 mysql-server

 

1, vim /etc/apache2/sites-availablle/wp
Add this content:
Alias /wp/wp-content /var/lib/wordpress/wp.content
Alias /wp /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
2, Enalbe the site
# a2ensite wp
# service apache2 reload
3, vim /etc/wordpress/config-oootwo.com.php
Add this content:
<?php
define(‘DB_NAME’, ‘wordpress’);
define(‘DB_USER’, ‘wordpress’);
define(‘DB_PASSWORD’, ‘password’);
define(‘DB_HOST’, ‘localhost’);
define(‘WP_CONTENT_DIR’, ‘/var/lib/wordpress/wp-content’);
?>
!!! replace password with a suitably secure password
4, vim ~/wp.sql
Add this content:
CREATE DATABASE wordpress;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
ON wordpress.*
TO wordpress@localhost
IDENTIFIED BY ‘password';
FLUSH PRIVILEGES;
!!! replace password with a suitably secure password
# cat ~/wp.sql | mysql –defaults-extra-file=/etc/mysql/debian.cnf

5, Go to http://oootwo.com/wp to complete it.

Base Linux System Environment

I have installed a lot of linux systems, such as Arch, Ubunt, Deepin, Freebsd, Centos, Fedora, OpenSuse, Gentoo, Lfs, Debian and so on.
Then I learn a lot about Installing Systems. When I have installed a system, I usually install some useful tools for it.
1, zsh oh-my-zsh
2, tmux
3, sudo
4, vim spf13-vim
5, w3m
6, chromium
7, i3
8, mutt
9, fcitx

1, Debian
Ubuntu, deepin
2, Centos
Fedora, Mageia
3, Arch
Manjaro
sudo pacman -S sudo zsh tmux
sudo pacman -S vim w3m i3 mutt chromium
4, openSuse
5, Gentoo
6, FreeBSD