feedburner
Enter your email address:

Delivered by FeedBurner

feedburner count

How To Setting up Apache Virtual Hosts in Ubuntu 14.04

Setting up Apache Virtual Hosts in Ubuntu 14.04 is a little complicated. First, you have to make directory for you web. 

mkdir /home/UserA/htdocs

sudo chown -R UserA:UserA /home/UserA/htdocs

sudo chmod -R 755 /home/UserA/htdocs

Next we'll create a test page for our virtual host.

echo 'Test Site' > /home/UserA/htdocs/index.html

Now we are going to start with a sane configuration for our new virtual host.

cd /etc/apache2/sites-available

sudo cp 000-default.conf 001-UserA.conf

We need to edit our base configuration for our purposes.

sudo nano 001-UserA.conf

In the file that opens change the ServerAdmin to your own email address DocumentRoot to our document root and add ServerName and set that to the name of the website

ServerAdmin admin@UserA.com

DocumentRoot /home/UserA/htdocs

ServerName UserA

We also want to set the different log files for our hosts so change the ErrorLog and CustomLog to read something like this:

ErrorLog ${APACHE_LOG_DIR}/UserA.error.log
CustomLog ${APACHE_LOG_DIR}/UserA.access.log combined

Lastly we want give Apache permission to access our folder. If you forget to add these lines you will receive a 403 Forbidden error when you try to access your website. Add these lines right after the log configurations:

<Directory /home/UserA/htdocs
Require all granted
</Directory>

Save and exit the file (Ctrl+X). Now in enable the virtual host

sudo a2ensite 001-UserA.conf

Check if there are any errors in the newly added configuration files

apachectl configtest

If you see a Syntax OK message then we have configured Apache correctly and are ready to reload the configuration

sudo service apache2 reload

Optionally you may want to edit your /etc/hosts file and add the new hostname there

sudo nano /etc/hosts

Add the following lines at the bottom of the file

127.0.0.1 UserA.com

 Now open your a browser and visit your virtual host site .


Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



How To Adding Additional Disk Drives to CentOS 5/6

Labels:

Adding a new drive to CentOS or RedHat systems.

Making use of a second drive for extra space? Here's a quick run-down:

1) Make sure you know which disk is being formatted. First, second, and third drives will be /dev/sda, /dev/sdb, and /dev/sdc respectively. Check this with fdisk -l

[03:50:04] [root@virt ~]# fdisk -l    Disk /dev/sda: 34.3 GB, 34359738368 bytes  255 heads, 63 sectors/track, 4177 cylinders  Units = cylinders of 16065 * 512 = 8225280 bytes       Device Boot      Start         End      Blocks   Id  System  /dev/sda1   *           1          13      104391   83  Linux  /dev/sda2              14        4177    33447330   8e  Linux LVM    Disk /dev/sdb: 8589 MB, 8589934592 bytes  255 heads, 63 sectors/track, 1044 cylinders  Units = cylinders of 16065 * 512 = 8225280 bytes    Disk /dev/sdb doesn't contain a valid partition table

2) You can see that /dev/sdb (our second hard drive) does not have any partitions. We will need to create a partition(s) on the drive and then make a file system on it, then mount it. Let's write partitions to the drive using fdisk /dev/sdb:

[03:53:01] [root@virt ~]# fdisk /dev/sdb  Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel  Building a new DOS disklabel. Changes will remain in memory only,  until you decide to write them. After that, of course, the previous  content won't be recoverable.    Command (m for help): m  Command action     a   toggle a bootable flag     b   edit bsd disklabel     c   toggle the dos compatibility flag     d   delete a partition     l   list known partition types     m   print this menu     n   add a new partition     o   create a new empty DOS partition table     p   print the partition table     q   quit without saving changes     s   create a new empty Sun disklabel     t   change a partition's system id     u   change display/entry units     v   verify the partition table     w   write table to disk and exit     x   extra functionality (experts only)    Command (m for help):

3) As you can see from the help menu (by using the command "m") we want to add a new partition. Using the defaults will use the entire disk. After it's created, you will want to use the command "w" to "write table to disk and exit".

Command (m for help): n  Command action     e   extended     p   primary partition (1-4)  p  Partition number (1-4): 1  First cylinder (1-1044, default 1): 1  Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):   Using default value 1044    Command (m for help): w  The partition table has been altered!    Calling ioctl() to re-read partition table.  Syncing disks.  [03:54:58] [root@virt ~]# 

4) Now you will notice that the output of fdisk -l /dev/sdb shows a partition as /dev/sdb1:

[03:57:08] [root@virt ~]# fdisk -l /dev/sdb    Disk /dev/sdb: 8589 MB, 8589934592 bytes  255 heads, 63 sectors/track, 1044 cylinders  Units = cylinders of 16065 * 512 = 8225280 bytes       Device Boot      Start         End      Blocks   Id  System  /dev/sdb1               1        1044     8385898+  83  Linux

5) Now we need to create a file system on it. I've always used ext3 for general use/purposes. You'll want to use the commandmkfs -t ext3 /dev/sdb1 as shown here:

[03:58:38] [root@virt ~]# mkfs -t ext3 /dev/sdb1  mke2fs 1.39 (29-May-2006)  Filesystem label=  OS type: Linux  Block size=4096 (log=2)  Fragment size=4096 (log=2)  1048576 inodes, 2096474 blocks  104823 blocks (5.00%) reserved for the super user  First data block=0  Maximum filesystem blocks=2147483648  64 block groups  32768 blocks per group, 32768 fragments per group  16384 inodes per group  Superblock backups stored on blocks:   	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632    Writing inode tables: done                              Creating journal (32768 blocks): done  Writing superblocks and filesystem accounting information: done    This filesystem will be automatically checked every 38 mounts or  180 days, whichever comes first.  Use tune2fs -c or -i to override.

6) Great, now we have a single partitioned secondary drive using ext3 file system. Now you want to create a directory to mount it in; lets just use "/drive2". You'll need to use the command mount -t [filesystem] [source] [mount directory] to mount it.

[03:59:50] [root@virt ~]# mount -t ext3 /dev/sdb1 /drive2/

7) Now you'll notice, via df, that the drive is mounted:

[03:59:57] [root@virt ~]# df -h  Filesystem            Size  Used Avail Use% Mounted on  /dev/mapper/VolGroup00-LogVol00                         28G  1.4G   25G   6% /  /dev/sda1              99M   19M   76M  20% /boot  tmpfs                1014M     0 1014M   0% /dev/shm  /dev/sdb1             7.9G  147M  7.4G   2% /drive2  

8) Last step - you want to make sure the drive automatically mounts itself when the server boots/reboots. You'll need to add the following line to your /etc/fstab file:

/dev/sdb1  /drive2  ext3  defaults 0 0

That's all

source : http://dbiers.me/

Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



How To Get Hard Drive UUID’s

Labels:

[root@demby vhosts]#ls -l /dev/disk/by-uuid/  
total 0  
lrwxrwxrwx 1 root root  9 Jan 10 15:43 3ecf7894-ef6e-4fc4-a8fb-b26d358ad775 -> ../../sdd  
lrwxrwxrwx 1 root root  9 Jan 10 15:43 61a9142a-b78f-4c90-a476-5ac481d5cc73 -> ../../sdc  
lrwxrwxrwx 1 root root 10 Jan 10 15:43 808d3e8b-b8f9-41ae-a457-4e44dede3cd1 -> ../../sdf1  
lrwxrwxrwx 1 root root 10 Jan 10 15:43 9f68a4e4-b166-4b22-8292-4cb263d341aa -> ../../sde1  
lrwxrwxrwx 1 root root  9 Jan 10 15:43 d0e98842-e77c-402b-998c-41de47b359ba -> ../../sdb  
lrwxrwxrwx 1 root root 10 Jan 10 15:43 df5e34f5-dd65-47ba-8690-2f09702d7b27 -> ../../sda1

That's all

source: dbiers.me
Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This



ISPConfig 3 configuration file

Labels: , ,

ISPConfig 3 has two different configuration files, one for the server part and one for the interface.

Interface:

/usr/local/ispconfig/interface/lib/config.inc.php

Server:

/usr/local/ispconfig/server/lib/config.inc.php

The mysql root password which is only used to create new mysql databases is stored in the file:

/usr/local/ispconfig/server/lib/mysql_clientdb.conf



Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This

How to change ISPConfig admin user password

Labels: , ,

In order to change ISPConfig administrator password you will have to connect to your MySQL using the command line. It can be done using the following command:

  • mysql -u root -p[yourrootpassword]

After that select the database called "dbispconfig". This can be done using the following command:

  • use dbispconfig; - selects the MySQL database called "dbispconfig"

Finnally execute the following command to change password :

  • UPDATE sys_user SET passwort = md5('NEWPASSWORD') WHERE username = 'admin'; - enter your desired password where text "NEWPASSWORD" is present.

After that simply connect to your ISPConfig using new admin password!

Read More.. Digg ThisAdd To Del.icio.us Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This