Showing posts with label Server Management. Show all posts
Showing posts with label Server Management. Show all posts

Aug 1, 2007

Install Subversion with Apache

After your system is up to date go get apache 2.0, subversion and webdav module

yum install httpd
yum install subversion
yum install mod_dav_svn
Now we need to create the directory for the repository:

mkdir /usr/local/svn

Now we need to create the repository

svnadmin create --fs-type fsfs /usr/local/svn
svn import /tmp/webqs/ file:///usr/local/svn/webqs/ -m "Initial import"
We need to configure apache
vi /etc/httpd/conf/httpd.conf

add
<location /repos>
DAV svn
SVNPath /usr/local/svn

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file

# For any operations other than these, require an authenticated user.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</Location>
Create a user and password (if you want to create more users leave out the -c switch, just use -m)

htpasswd -cm /etc/svn-auth-file huusan
New password: *****
Re-type new password: *****
Adding password for user huusan

Restart httpd service
# service httpd restart
After it boots back up open a web browser to your subversion machine (http://127.0.0.1/repos) it will prompt you for your user name and password and there you go.

Jul 8, 2007

VirtualHost in Apache Sample

Create two virtual host anh.biz.tm and mangmaytinh.biz.tm
Append to the end of file /etc/httpd/conf/httpd.conf

NameVirtualHost *:80
<
VirtualHost *:80>
ServerAdmin onlyyoumakemesmile@gmail.com
DocumentRoot /var/www/html/anh.biz.tm/simpleviewer
ServerName anh.biz.tm
ErrorLog logs/anh.biz.tm-error_log
CustomLog logs/anh.biz.tm-access_log common
</
VirtualHost>

<VirtualHost *:80>
ServerAdmin onlyyoumakemesmile@gmail.com
DocumentRoot /var/www/html/mangmaytinh.biz.tm/wordpress
ServerName mangmaytinh.biz.tm
ErrorLog logs/mangmaytinh.biz.tm-error_log
CustomLog logs/mangmaytinh.biz.tm-access_log common
</VirtualHost >


Test syntax using
$ httpd -S

Apr 1, 2007

System Startup File

A single Linux system can provide several different services such as mail, Web, or FTP servers. Each service operates as a continually running daemon looking for requests for its particular services from remote users. We can turn services on or off by starting or shutting down their daemons. The process of starting or shutting down a service is handled by service scripts
1. System Startup File: /etc/rc.d and /etc/sysconfig
A series of startup commands are located in /etc/rc.d directory.
/etc/rc.d/rc.sysinit
holds the commands for initializing system, including the mounting and unmounting of file systems.
System Startup Files:
/etc/sysconfig: Directory that holds system configuration files and directories.
/etc/rc.d: Directory that holds system startup and shutdown files.
/etc/rc.d/rc.sysinit: Initialization file for system.
/etc/rc.d/rc.local: Initialization file for my own commands, can be free edit this file to add my own startup commands, this is the last startup file executed.
/etc/rc.d/modules: Loads kernel modules
/etc/rc.d/init.d:
Directory that holds network scripts to start up network connections.
/etc/rc.d/rc.num.d: Directories for different runlevels, where num is the runlevel. The directories hold links to scripts in the /etc/rd.d/init.d directory.
/etc/rc.d/init.d/halt: Operations performed each time you shut down the system, such as unmounting file systems, called rc.halt in other distributions.
/etc/rc.d/init.d/cups: Start up and shutdown the cups printer daemons.
/etc/rc.d/init.d/xinetd: Operations to start up or shutdown the xinetd daemon.
/etc/rc.d/init.d/network: Operations to start up or shutdown the network connections.
/etc/rc.d/init.d/httpd: Operations to start up or shutdown the Web server daemon, httpd.
To configure a service to start up automatically at boot, we can use te redhat-config-services tool available on the desktop or the chkconfig tool, which is run at a command line.