WordPress on non default port
If you need to set up WordPress on a port other than 80, go to Settings -> General and alter the “WordPress Address (URL)” and “Site Address (URL)” to your new address and port. For example: http://192.168.1.65:3009
If you need to set up WordPress on a port other than 80, go to Settings -> General and alter the “WordPress Address (URL)” and “Site Address (URL)” to your new address and port. For example: http://192.168.1.65:3009
Whenever I need to upgrade ruby’s postgres adapter (gem install pg), I get errors that pg_config cannot be found. Solution (depending on your postgres installation):
gem install pg — –with-pg-config=/usr/pgsql-9.2/bin/pg_config
I was in a situation where I needed to transfer more than 100 GB of data comprised of hundreds of thousands of files. This is a simple and dirty way to transfer the files between servers in the same data center (where you don’t need any security via ssh).
On the server you are transferring to:
nc -l 60000 | tar -xf -
On the server you are transferring from:
tar cf - data/ | nc 192.168.1.212 60000
I followed the tutorial following tutorial with some modifications – will edit when I have time.
source: http://allanfeid.com/content/creating-chroot-jail-ssh-access
First, make sure you have openssh 5+ installed. (`sshd -v` to find which version)
Make the end of /etc/ssh/sshd_config look like this:
# override default of no subsystems
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
# Example of overriding settings on a per-user basis
Match Group sftpuser
ChrootDirectory /var/www/html/whatever_folder
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no
SFTP won’t work quite yet – you need to make the ChrootDirectory owned by root (it wont work otherwise).
chown root:root /var/www/html/whatever_folder
Now you can log in as a sftpuser, but you can’t create directories or files yet in this directory since it’s owned by root (it needs to be for sftp to work).
mkdir /var/www/html/whatever_folder/public
chown sftpuser:sftpusers /var/www/html/whatever_folder/public
sources:
http://askubuntu.com/questions/49271/how-to-setup-a-sftp-server-with-users-chrooted-in-their-homedirectories
http://askubuntu.com/questions/134425/how-can-i-chroot-sftp-only-ssh-users-into-their-homes
We’re going to build openssh5.8 as a local repo – make sure you do this as a non-root user. In our case, we’ll be using the buildermaster user.
Login as buildmaster and create the following dirs in the home dir:
[buildmaster@hostname ~]$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
Change the build directory for buildmaster from /usr/src/redhat to /home/buildermaster/rpmbuild:
[buildmaster@hostname ~]$ echo ‘%_topdir %(echo $HOME)/rpmbuild’ > ~/.rpmmacros
Download openssh.
Copy openssh source and spec files to the following locations (spec file is openssh-5.8p1/contrib/redhat/openssh.spec):
/home/buildmaster/rpmbuild/SOURCES/openssh-5.8p1.tar.gz
/home/buildmaster/rpmbuild/SPECS/openssh.spec
Make sure you have pam-devel:
yum install pam-devel
Build the RPMS (while in /home/buildmaster/rpmbuild/SPECS/):
rpmbuild -bb openssh.spec
Now, as root:
cd /home/buildmaster/rpmbuild/RPMS/i386/
rpm -Uvh *.rpm (this assumes only openssh rpms are in this folder)
If you run into an issue with openssh-askpass, yum remove openssh-askpass before
you run rpm -Uvh *.rpm
Go ahead and:
service sshd restart
You should remain connected if you’re ssh’d in. If you run sshd -v, you should now be on the correct version.
Sources:
Centos forum
Centos RPM Build
http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
http://www.owlriver.com/tips/non-root/
Trying to figure out the best way to keep servers consistent, we’re on Centos 5.x, but need to upgrade some packages outside our normal repos’ ability.
Want to keep things in yum for ease, so we setup local rpm build environment as above, and use yum –nogpgcheck install foo.rpm to handle yum version collisions etc
This will enable awstats access on all sites on the server
Install & Configure AWStats
Install AWStats
yum install awstats
Modify AWStats Apache Configuration
Edit /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/
ScriptAlias /awstats/ /var/www/awstats/
DirectoryIndex awstats.pl
Options ExecCGI
order deny,allow
allow from all
Edit the following lines in the default awstats configuration file
/etc/awstats/awstats.localhost.localdomain.conf
SiteDomain=”
HostAliases=”
Rename config file
mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.
Update Statistics (Note: By default, statistics will be updated every hour.)
/usr/bin/awstats_updateall.pl now -confdir=”/etc” -awstatsprog=”/var/www/awstats/awstats.pl”
Start Apache
/etc/init.d/httpd start
Verify Install
Go to
http://
(excerpted from http://docs.cslabs.clarkson.edu/wiki/Install_AWStats_on_CentOS_5 )
I put up a site at Tohoku Kanto Japanese Relief Earthquake Tsunami describing a project I am involved with getting Burning Man veterans to Japan to help the city of Rikuzentakata.