Hacks

WordPress in my Intranet

Posted on January 4, 2007. Filed under: Hacks |

I initially tried installing apache, then php, then mysql and then installing wordpress.  I basically gave up on that (since I needed to focus on other more important tasks), and used xampp (www.apachefriends.org)… a beautiful package that comes with everything in about 30mb (apache, mysql, php, perl, phpmyadmin, ftp server, mercury – for pop3 and smtp).  the default installation is insecure… something that should be addressed after installation.  I use phpmyadmin to create the db and user, copy the wordpress folder to the htdocs folder and I am almost done.

Just one hack, the wordpress setup said that “newuser@localhost” was an invalid email id… so I edited the \winnt\system32\drivers\etc\hosts file and added “127.0.0.1 localhost.com” and used newuser@localhost.com as the email id.

I am doing this to setup an intranet blog for the managers and team leads to post messages of general interest everyone to follow up on… should allow employees to follow what the big guys are doing… when they have the time… and should get the big guys things down in writing. (hmm… maybe I should remove the delete_post links!)

technorati tags:, , ,

Blogged with Flock

Advertisements
Read Full Post | Make a Comment ( None so far )

Virtual Hosts in Apache 2.2

Posted on December 4, 2006. Filed under: Hacks |

I installed apache 2.2 in c:/program files/apache software foundation/apache2.2.  The default domain was cause.in, and the default website was www.cause.in.

I needed to add a virtual host, like mysite.cause.in, and I needed the document root for that site to be in some other folder, other than c:/program files/…/htdocs.  I needed it to be in c:/www/docs/sites/mysite.

First off, in C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf, at the very bottom, there are these two lines:

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

What I do is remove the comment from the second line.

Then I open the httpd-vhosts.conf file… this is what I do to it.  Compare this with what you have in your vhosts.conf file.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
NameVirtualHost mysite.cause.in:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost mysite.cause.in:80>
    ServerAdmin webmaster@mysite.cause.in
    DocumentRoot /www/docs/sites/mysite
    ServerName mysite.cause.in
    ServerAlias mysite.cause.in
    ErrorLog logs/mysite.cause.in-error.log
    CustomLog logs/mysite.cause.in-access.log common
</VirtualHost>

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.cause.in
#    DocumentRoot /www/docs/dummy-host2.cause.in
#    ServerName dummy-host2.cause.in
#    ErrorLog logs/dummy-host2.cause.in-error_log
#    CustomLog logs/dummy-host2.cause.in-access_log common
#</VirtualHost>

Finally, I go back to the httpd.conf file and add a Directory directive just below the Directory directive for htdocs and above the IfModule dir_module.

<Directory “C:/www/docs/sites”>
 Order allow,deny
 Allow from all
</Directory>

I create a dummy index.html in c:/www/docs/sites/mysite, and restart apache:

net stop apache2.2

net start apache2.2

Then I open my hosts file, from c:\windows\system32\drivers\etc in notepad and add these two lines.

192.168.1.2 www.cause.in
192.168.1.2 mysite.cause.in

here 192.168.1.2 is my computers ip. you can set it 127.0.0.1 and you will see it work on your pc.

I open my browser and say http://mysite.cause.in and I see the results from the new folder.

Read Full Post | Make a Comment ( None so far )

  • Posts

  • del.icio.us

  • Blog Stats

    • 77 hits
  • Meta Information

Liked it here?
Why not try sites on the blogroll...