Tuesday, December 11, 2007

htpasswd

This information what is explained below is already a well discussed issue in many forums and sites.. you get it immediately when you google for creating htpasswd enabled sites or just htpasswd. But i just wanted to post it here as i tend to forget some silly things.. and it would help me when i forget it again.

So now, what i do here is what was advised from one of my friend.

You need to just add the following lines to httpd.conf file in /etc/apache2/

AuthName "Restricted Access"
AuthType Basic
AuthUserFile /etc/passwords/.htpasswd
Require valid-user


/var/www/restricted is the directory which contains webpages or files which needs user authentication for viewing or for downloading. You can Give anything for AuthName in quotes. /etc/passwords/.htpasswd is the file where the username and passwords(encrypted) are placed. You could store this information anywhere you want but specify the location at AuthUserFile.. It should be .htpasswd file.

Now we create the .htpasswd file with a command

:#htpasswd -c /etc/passwords/.htpasswd username

You would be then prompted to enter the password

New Password : guest
Re-type new Password : guest
Adding password for user username

so the -c option creates the .htpasswd file if not present and adds the user. The next time you use htpasswd for the same location you need not use -c option...So now only those users would be able to access the restricted pages and files.

if you do a cat on the .htpasswd file, it would look as below..

username:uxl0NERvhkPgI

Typo3, Reference Index

Hi, These days i am trying my hands on Typo3. It really interests me a lot. So i have just begun with it. I had encountered a small problem after installing Typo3. I shall explain what i had done to get rid of this.

The problem was after the 3-step installation. there were about 3 warning which i had to clear. ofcourse, the solution to the 3 warning were also displayed there itself... but i couldn't clear the third warning which says something like the reference index in the database do not match so please go to the DB Check tool under tool menu and do an update. I did this and it say the reference indexes have been updated successfully. I do a check now and i get a message saying there was nothing written and please do an update using "-E". There is no option in the administration window to do an update with -E. it is neither in the console of the server. And the warning still remains. After a lot of search, i found out in a forum, saying that new installation solves the problem...

ok fine, so i had made a file again called ENABLE_INSTALL_TOOL in typo3conf and did "chown www-data:root ENABLE_INSTALL_TOOL". Now i go on to the administration window and i click on the install tool under tool menu. and i am prompted for the password. i give my administration password and enter.. After that i just went to the update wizard, did an update. You actually need not do this unless you really want to update typo3. You can just go to the Database wizard and do a compare, import and so on.. just do all the things specified there one by one other than the "create admin user" and "Clear tables". Once done. Click on the "About Modules tool" under Help. you would be again prompted with the 3 warnings this time i had done the 3rd warning first. That is to go to the DB Check and do an update now.. there i get a list of updates done.. Now the problem is solved and i just solve the other warnings as said and now i have a typo3 with no warnings at all. My webpage was also not destroyed during this process.

Friday, November 16, 2007

Netgear, VLANs

Hi,

Today, we were trying to figure out how to have tagged vlans in our server room with the help of existing netgear switches. It was actually quite easy, but we were just messed up with all the information. I think this particular issue wasn't mentioned at all in the user guides or in any of the manuals. ofcourse they would tell you what an tagged vlan means.

Ok now what we had done for it. We had four switches and 3 vlans namely internal network, external network 1, external network 2. Why first of all tagged vlans. good, we wanted to have tagged vlans as we did not want to manually keep changing the network cable of a particular server from one port on the netgear to the other when the server needed to be in another network. Instead of that it would be better if we could just change the vlanid of the particular port to the desired network. But then how would a transmitted packet know where and how to go. This is where a tagged vlan works. We had configured 2 ports on each switch as tagged [T] port 1 and 24. 24th port would be connected to the port 1 of the next and so on. These tagged ports should be members of all the vlans, so that the switch knows where the packet should be transmitted. An important thing is that, all the switches should be configured for all the vlans. Therefore all our 4 switches had all the 3 vlans.

We had left the other ports (i.e other than 1 and 24) as untagged or empty. In each switch we had some ports which were members of a particular vlan or vlans. so the member port were maked as untagged except for 1 and 24. And thats it. the tagged vlans worked. we did have some problem with a switch as it was not accessible through the network but only by direct ethernet connection. This was solved by just changing the pvid of the tagged ports from 1 to 2.

So now what happens is when ever a packet arrives at a switch, it would see the vlanid of the packet and forwards it to the particular vlan. if the destination exists in the switch it goes to the particular server otherwise it would be forwarded to the other switch through the tagged path. The tagged port attaches the destination label to the packet, so that the other switch know where this packet heads to. This goes on until the packet has reached the destination.

So this way you need not change the network cable manually, but you could just change the vlan membership of the particular port on the netgear using the web-interface. So things are made just easy. Now you can keep playing with your ports by changing them from one to the other without having to do anything physically on the switch.

Tuesday, November 13, 2007

Introduction

Hi,

This is my first post on this blog. I work part-time as a System-administrator, so i thought i could address some of the problems i face during my usual work and how they are solved if at all i find a solution for them ;-) on this blog. Hoping that it might be helpful for others at somepoint of time...I should also inform you before hand that i am no nerd. I do what i can to my capability... i always welcome comments as i need to learn a lot in this vast area of system administration. This is one area where i love to work the most.. it fascinates me in and out.

will meet you soon in the coming posts...

Regards,
Giri