Archive for November, 2008

Apache(http) installation & configuration on Red Hat @ Ubuntu

magnet November 26th, 2008

Apache on Red Hat Linux

 

 Intoduction Of  Apache

Apache is the name of the software that allows you to run a web service.Apache is very popular and provides access to most web sites on the internet.Apache complies with the Hypertext Transport Protocol (HTTP).

Apache is a Application which works on HTTP protocol.

Configuration of Apache(HTTP) on Red Hat

First install http package with the help of yum.

# yum install http*

Then go on configuration file

# vi /etc/httpd/conf/httpd.conf

here come to bottom of file & edit these lines to create a web site

#NameVirtualHost *
#
#<virtual hosts *>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</virtual hosts>

In first line at the place of * add the IP Address of your machine on which you are creating apache.

In second line ServerAdmin give Email ID, this will help you when http will give any problem.
Here http will send message on this Email ID.It will be help full for system admin to solve the
problem.

Now DocumentRoot:-

DocumentRoot is a (folder) that is stored on your host’s servers and that is designated for holding web pages. When someone else looks at your web site, this is the location they will be accessing.

Default DocumentRoot is /var/www/html

Now we come to the ServerName:-

ServerName specifies a hostname and port number (matching the Listen directive) for the server. The ServerName does not need to match the machine’s actual hostname. For example, the Web server may be www.example.com, but the server’s hostname is actually foo.example.com. The value specified in ServerName must be a valid Domain Name Service (DNS) name that can be resolved by the system.

Example:- ServerName www.suraj.com

ErrorLog:- Log will be generated here regarding http adversities.

CustomLog:-

CustomLog identifies the log file and the log file format. In your Web server’s default configuration, CustomLog defines the log file in which accesses to your Web server are recorded: /var/log/httpd/access_log. You will need to know the location of this file if you want to generate any access-based server performance statistics for your Web server.

CustomLog also sets the log file format to common.

Note:- To edit these all line you will have to remove # to enables the lines.because lines are commented by hash(#).

By doing this editing & configuration in this file we can
host any web site.

Note:- if http is already installed you can omit the first line. Your web files will now be found in /var/www/

Consept Of Virtual Hosting

Virtual Hosting:- Virtual hosting means we can create two or more then two web sites on single server.

To enable virtual host enable the <NameVirtualHost *> line by removing the commenet hash(#).And give your ystem IP at the place of star(*).

Now you can create more web sites on single server.

 

Ubuntu

 

Installation and configuration of apache(http) in Red Hat & Ubuntu is some thing different,like commands,configuration files etc.

 

 Installation of apache in ubuntu 

 

 Installing package of Ubuntu is .deb

 apt-get:-

 

# apt-get install apache2

# apt-get install php5

# apt-get install libapache2-mod-php5

 

  Configure apache2

 

 Apache2 configuration file in Ubuntu is usually found in this location /etc/apache2/apache2.conf.

Apache is configured by placing directives in plain text configuration files. Apache2 ships with a virtual-host-friendly default configuration. It is configured with a single default virtual host.

If you wish to configure a new virtual host or site, copy /etc/apache2/sites-available/default file into the same directory with a new name. For example,
“sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mynewsite”

Edit the new file to configure the new site:

To start using New Virutal Host we have to modify at least two directives.
1. ServerName (Put your domain name here)
2. DocumentRoot (path to website)

The /etc/apache2/sites-available directory is not parsed by Apache2. Symbolic links in /etc/apache2/sites-enabled point to “available” sites. Use the a2ensite (Apache2 Enable Site) utility to create those symbolic links.

Change the directory to
“cd /etc/apache2/sites-enabled”
“sudo a2ensite mynewsite”
Similarly, the a2dissite utility should be used to disable sites.

We should be all set to run apache2 server in Ubuntu.
The above configuration will work only if certain modules are enabled. Usually the required modules are available in the default apache2 configuration file.

After do the configuration in file we will have to restart service to save configuration.

Restart apache service:

#/etc/init.d/apache2 restart

Note:- if apache is already installed you can omit the first line. Your web files will now be found in /var/www/

 

 

creating a ssl certificate

magnet November 6th, 2008

 ssl certificatesd

  • A little tutorial on creating an SSl certificate, you can also generate your own self signed certificate:-

1)  The first step is to create your RSA Private Key. This key is a 4096 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text.

>> openssl genrsa -des3 -out domainname.com.key 4096

Once you run the above command, it will ask you to enter a Pass phrase for your domain key file.

2) Generating a CSR   (Certificate signing request)  :-

Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as Thawte or Verisign who will verify the identity of the requestor and issue a signed certificate. or you can use it to create your own self signed certificate for intranets or for demo purpose.

These are the X.509 attributes of the certificate. One of the prompts will be for “Common Name (e.g., YOUR name)”. It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be https://domainname.com, then enter domainname.com at this prompt. If you want to create a so called “wildcard” certificate, which means the same certificate can be used on an unlimited number of subdomains, just enter an asterisk as the hostname, in our example that would be *.domainname.com.

>>  openssl req -new -key domainname.com.key -out domainname.com.csr

Once the above command is run, it will ask you the following set of questions :

Enter pass phrase for domainname.com.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:


3) Removing the Pass phrase from the key :-

One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file only be readable by the root user! If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:

>> cat domainname.com.key >domainname.com.key.orig

>> openssl rsa -in domainname.com.key -out domainname.com.key

* Once you have geerated the csr file , you can provide the csr  file which you can send to the certificate authority like thawte or verizon for verification and they will verify and issue the signed certificate which you can apply on your domain in apache you can also use the certificate for your smtp, pop , imap and ftp.  You can also have a free signed certificate from  http://cacert.org, they will verify and issue you the signed certificate.

If you want to generate your own self signed certificate to use in an intranet or for demo, then move ahead to the next step :

4) Generating a Self-signed certificate :

This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.

>>  openssl x509 -req -days 365 -in domainname.com.csr -signkey domainname.com.key -out domainname.com.crt

Now you have generated your own self signed certificate, you need to have the mod_ssl module in your Apache.

You need to make entries  in your apache config file too enable the website to be working with https://

it would httpd.conf  or apache.conf file depending upon the Linux distributing you are using.

Also you can refer to the following blogs and sites which were helpful for me to knoe about the ssl and also able to intall the ssl certificate for my website :

www.yatblog.com/2007/02/27/how-to-create-a-ssl-certificate/

www.tc.umn.edu/~brams006/selfsign.html

www.geotrusteurope.com/support/csr/csr_apache.htm

And for any one trying to install apache with SSL on a ubuntu gutsy or fiesty like i was trying to, refer to the following URL :

help.ubuntu.com/community/forum/server/apache2/SSL

Hope this little article was helpful.

 

unix

Thank you

Systems Team

MAC OS booting problem on Intel PC

magnet November 5th, 2008


Problem

I installed kalyway 10.5.2 and it installed, and went through the setup process with no problem.

Upon  reboot, got the error “no bootable device – insert boot disk” message.


Solution

Boot up the Kalyway install DVD again

  • Under the “Utilities” menu, open “Terminal”.
  • Issue “diskutil list”. My hard disk showed up as /dev/disk0, and my install partition is /dev/disk0s2
  • Issue “diskutil unmount /dev/disk0”
  • Issue “fdisk –e /dev/disk0”
  • Issue “f2”, where 2 comes from “/dev/disk0s2”. The response back is “Partition 2 marked active”.
  • Issue “write”. The response back is “Writing MBR at offset 0.”
  • Issue “quit”. Fdisk exits.

Quit the Terminal program and Quit the installer.

 

Reboot your machine

Enjoy.

 

Thank You,

System Team