OpenFiler Installation On Headless NAS

So, you have a Dell 715N nas or similar and wish to install OpenFiler onto it? This nas is headless, it has no USB ports, no CDROM, no floppy. It’s only connection to the outside world is it’s serial port and it’s network interfaces (2).

You may or may not have installed Linux via PXE boot before. You also may or may not have used a serial console. Today we will do both in order to install OpenFiler.

OpenFiler is built using rBuilder, which is rPath’s distro creation tool. This system spits out .iso files (among other formats) that are very similar to (read: based upon) RedHat installation CDs. They use Anaconda as their installer. Thus documentation pertaining to kickstart servers applies here. Follow the steps below to perform the installation.

Read more

Share

Nginx wordpress fancy URL or permalink fixing

If your wordpress is installed in the root directory i.e. yourdomain.com, you can use the following directives-

location / {
try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires max;
log_not_found off;
}

Or if your wordpress is installed inside a sub-directory the directive will be a bit different-

location /test/site1 {
try_files $uri $uri/ /test/site1/index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /test/site1/wp-admin$ $scheme://$host$uri/ permanent;

Share

Reset the root password in Debian or Ubuntu

In order to boot into the recovery mode on Debian or Ubuntu, hold down SHIFT key after powering on your Linux machine. You will then be presented with GRUB menu. Select “recovery menu” option by pressing down arrow key. Do not press ENTER at this point, but rather press “e” key to enter edit mode.

You will see “GRUB” edit screen where you can edit GRUB boot parameters. Move your cursor to the line starting with “linux /boot/vmlinuz-…….”, and go to the end of that line. Append “init /bin/bash” right there, as shown below.

Then press Ctrl+X to proceed. After all subsequent booting sequence is over, you will finally get a root prompt.

In the recovery mode, the root partition is mounted as read-only by default, and so you cannot change the root password as is. In order to be able to reset the root password, you need to re-mount the root partition as read-write.

First, find out what the root partition of your system is, by using “fdisk -l” command.

As shown in the screenshot above, the partition marked with “*” under “Boot” column is the root partition of your system (e.g., /dev/sda1).

Remount the root partition as read-write, and finally reset the password, using passwd command.
$ mount -o remount,rw /dev/sda1 /
$ passwd

Share

NTP Adjust date on Linux

If you want to set date/time on linux manually (instead of using synchronization like ntp) you may use the date command to do it.

Login as root and run the following command, it will show you the

current date/time.

[root@servername ~]# date

Output will be like Tue Aug 23 12:32:22 EDT 2011

Now to set the desired date/time use the same date command with an argument of your required date/time as following format;

Read more

Share

Install nginx using yum on CentOS or SL Linux

Step #1: Install nginx repo

Type the following wget command to install nginx yum configuration file:
# cd /tmp

CentOS Linux v6.x user type the following command:
# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm

RHEL v6.x user type the following command:
# wget http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm

Read more

Share

Install htop on CentOS 5 or 6

Install RPM for CentOS 5.x

32-BIT

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i686.rpm
rpm -Uhv rpmforge-release*.rf.i386.rpm

64BIT

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
rpm -Uhv rpmforge-release*.rf.x86_64.rpm

Install RPM for CentOS 6.x

32-BIT

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -Uhv rpmforge-release*.rf.i386.rpm

64BIT

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uhv rpmforge-release*.rf.x86_64.rpm

Install htop in CentOS Using YUM

Once the repository is installed, all you need to do to install htop in CentOS is run the following:

yum install htop

Share

How to clear the yum cache

When a package is downloaded, installed and is removed there is a chance that the package may still be saved/stored in the yum’s cache. So to clean all the cached packages from the enabled repository cache directory, login as root and execute the following:

yum clean packages

To purge the old package information completely, execute the following command:

yum clean headers

To clean any cached xml metadata from any enabled repository, execute the following

yum clean metadata

If you wish to clean all the cached files from any enabled repository at once, execute the Following command:

yum clean all
Share

Resetting CentOS 5 Root Password

If you have forgotten the root password it is possible to set a new one as follows:

  1. Interrupt the boot at the GRUB stage and boot to runlevel 1, AKA single user mode.
  2. Interrupt GRUB by typing a character such as "space" then append to the kernel line by typing "a",
  3. backspacing through "rhgb quiet" and appending " 1<enter>".
  4. This will give you a root shell and not a login prompt. From there you can use the "passwd" command to set a new root password.

Other user passwords can be reset, and other administrative tasks can be performed as well. Exiting the single user root shell will boot to the multi-user mode defined in /etc/inittab.

Share

Install VPN PPTP Server on CentOS

In this tutorial, I will use pptp as protocol to connect to VPN server using a username and password, with 128 bit MPPE encryption. Variable as below:

OS: CentOS 6 64bit
VPN server: 209.85.227.26
VPN client IP: 209.85.227.27 – 209.85.227.30
VPN username: vpnuser
Password: myVPN$99

Install ppp via yum:

$ yum install ppp -y

Download and install pptpd (the daemon for point-to-point tunneling). You can find the correct package at this website http://poptop.sourceforge.net/yum/stable/packages/ :

$ cd /usr/local/src
$ wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.el6.x86_64.rpm
$ rpm -Uhv pptpd-1.3.4-2.el6.x86_64.rpm

Updated rpm link-

https://lnmpp.googlecode.com/files/pptpd-1.3.4-2.el6.x86_64.rpm

Once installed, open /etc/pptpd.conf using text editor and add following line:

localip 209.85.227.26
remoteip 209.85.227.27-30

*in remoteip you can use your lan interface IP if you have dual interface.

Open /etc/ppp/options.pptpd and add authenticate method, encryption and DNS resolver value:

require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8

Lets create user to access the VPN server. Open /etc/ppp/chap-secrets and add the user as below:

vpnuser pptpd myVPN$99 *

The format is: [username] [space] [server] [space] [password] [space][IP addresses]

We need to allow IP packet forwarding for this server. Open /etc/sysctl.conf via text editor and change line below:

net.ipv4.ip_forward = 1

Run following command to take effect on the changes:

sysctl -p

Allow IP masquerading in IPtables by executing following line:

$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ service iptables save
$ service iptables restart

Update: Once you have done with step 8, check the rules at /etc/sysconfig/iptables. Make sure that the POSTROUTING rules is above any REJECT rules.

Turn on the pptpd service at startup and reboot the server:

$ chkconfig pptpd on
$ init 6

Once the server is online after reboot, you should now able to access the PPTP server from the VPN client. You can monitor /var/log/messages for ppp and pptpd related log. Cheers!

Src: http://blog.secaserver.com/2011/10/install-vpn-pptp-server-centos-6/

 

Share