Tagged: linux RSS Toggle Comment Threads | Keyboard Shortcuts

  • webscriptz 00:06 on 25/03/2011 Permalink | Reply
    Tags: 127.0.0.1, apache, apache2, bind9, , console, , dns, fedora, hosts, httpd, linux, local domain name, name-based virtual host, nano, virtual hosts   

    Fedora Core – virtual hosts httpd 

    I’ve reinstalled my pc with Fedora Core recently, because of the extended SELinux and more tools that are at my disposal. A problem I always had with ubuntu was the configuration of Apache virtual hosts. Once they where installed I needed to put them into the host file and each time I reconnected to a network the NetworkManager rewrote the hosts file annoying me and the fact that if one was configured localhost would also begin pointing to it, a rather nasty thing.

    First you need to open the console and login with your root user, type su and fedora will already know what to do.

    You need to shutdown the httpd servic deamon with the command :

    1
    /etc/init.d/httpd stop

    You will have to open /etc/httpd/conf/httpd.conf, once opened you will have to locate the section on virtual hosts and you should see an example that is already commented out., I edited the files with nano in the console.

    1
    ### Section 3: Virtual Hosts

    Instead of telling you which lines to uncomment, I’m going to show you below, the stanzas to add to the Virtual Host section to get companyABC.com and companyDEF.com websites running:

    001
    #
    002
    # Virtual hosts
    003
    #
    004
     
    005
    # Virtual host Default Virtual Host
    006
    <VirtualHost *>
    007
    DocumentRoot /var/www/html/
    008
    ErrorLog logs/error_log
    009
    ServerAdmin root@localhost
    010
     
    011
     
    012
     
    013
    ServerSignature email
    014
    TransferLog logs/access_log
    015
    DirectoryIndex index.php index.html index.htm index.shtml
    016
     
    017
     
    018
    SSLEngine off
    019
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    020
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    021
     
    022
    SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
    023
     
    024
    SSLOptions
    025
    LogFormat "None"
    026
    TransferLog logs/access_log
    027
    ErrorLog logs/error_log
    028
    LogLevel debug
    029
    HostNameLookups off
    030
     
    031
     
    032
     
    033
     
    034
    </VirtualHost>
    035
     
    036
    # Virtual host resume.loc
    037
    <VirtualHost 127.0.0.1>
    038
    DocumentRoot /var/www/html/mdw/resume
    039
    ErrorLog logs/error_log
    040
    ServerAdmin root@localhost
    041
    ServerName resume.loc
    042
     
    043
     
    044
    ServerSignature email
    045
    TransferLog logs/access_log
    046
    DirectoryIndex index.html index.php index.shtml
    047
     
    048
    <Directory "/var/www/html/mdw/resume/">
    049
    Options all
    050
     
    051
    AllowOverride all
    052
     
    053
     
    054
     
    055
    </Directory>
    056
     
    057
     
    058
    SSLEngine off
    059
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    060
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    061
     
    062
    SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
    063
     
    064
    SSLOptions
    065
    LogFormat "None"
    066
    TransferLog logs/access_log
    067
    ErrorLog logs/error_log
    068
    LogLevel error
    069
    HostNameLookups on
    070
     
    071
     
    072
     
    073
     
    074
    </VirtualHost>
    075
     
    076
    # Virtual host linker
    077
    <VirtualHost 127.0.0.1>
    078
    DocumentRoot /var/www/html/mdw/linkerv2/
    079
    ErrorLog logs/error_log
    080
    ServerAdmin root@localhost
    081
    ServerName linker.loc
    082
     
    083
     
    084
    ServerSignature email
    085
    TransferLog logs/access_log
    086
    DirectoryIndex index.html index.php index.shtml
    087
     
    088
     
    089
    SSLEngine off
    090
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    091
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    092
     
    093
    SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
    094
     
    095
    SSLOptions
    096
    LogFormat "None"
    097
    TransferLog logs/access_log
    098
    ErrorLog logs/error_log
    099
    LogLevel error
    100
    HostNameLookups on
    101
     
    102
     
    103
     
    104
     
    105
    </VirtualHost>
    106
     
    107
    # Virtual host Virtual Host 1
    108
    <VirtualHost 127.0.0.1>
    109
    DocumentRoot /var/www/html/mdw/site
    110
    ErrorLog logs/error_log
    111
    ServerAdmin root@localhost
    112
    ServerName mdw.loc
    113
     
    114
     
    115
    ServerSignature email
    116
    TransferLog logs/access_log
    117
    DirectoryIndex index.html index.php index.shtml
    118
     
    119
     
    120
    SSLEngine off
    121
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    122
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
    123
     
    124
    SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
    125
     
    126
    SSLOptions
    127
     
    128
    TransferLog logs/access_log
    129
    ErrorLog logs/error_log
    130
    LogLevel error
    131
    HostNameLookups on
    132
     
    133
     
    134
     
    135
     
    136
    </VirtualHost>
    137
     
    138
     

    After you have added the host(s), save the file. At this point, you will need to add the appropriate records to your DNS server to make these domains reachable by anyone on the network. If you have no access to a DNS server (BIND9), or you just want to test the configuration, just edit your /etc/hosts file. Here is what my file looks like:

    1
    # Do not remove the following line, or various programs
    2
    # that require network functionality will fail.
    3
    127.0.0.1               localhost.localdomain localhost
    4
    127.0.0.1               host1.loc
    5
    127.0.0.1               host2.loc
    6

    Once hosts is saved you just restart your server and everything should work without a problem

     
    • webscriptz 11:47 on 30/03/2011 Permalink | Reply

      This is if you have a server distribution installed on a laptop like I do for development purposes.

      Note that this works best with a server distribution because,if you take, for instance the Ubuntu desktop edition an make a webserver for development purposes you will have disable NetworkManager
      or each time you connect to a different network rewrite the /etc/hosts to be able to access your websites via the link specified by you.

      Fedora, RHEL and centOS use /etc/resolv.conf for the IP-address currently used by the PC where Ubuntu for instance use /etc/hosts and thus rewrites it as soon as you change from network.

    • webscriptz 23:09 on 30/03/2011 Permalink | Reply

      A friend pointed out that When in production you should patch the server, here’s a good article describing howto: http://mitka.us/articles/mpm-itk/

  • webscriptz 19:15 on 28/12/2010 Permalink | Reply
    Tags: , linux,   

    Reclaim partial select in firefox 

    In the windows version of Firefox you can select a single word of your address, in ubuntu it’s been changed and here’s the fix:

    type: ‘about:config’ in your address-bar and click that you’ll be careful with the settings
    search for: ‘browser.urlbar.doubleClickSelectsAll’ and double click it

    You don’t have to relaunch Firefox for the browser to notice the change.

     
  • webscriptz 14:59 on 07/11/2010 Permalink | Reply
    Tags: backspace, , , linux,   

    Reclaim Ubuntu firefox backspace key 

    Firefox and every other browser on windows features a ‘previous page hotkey’, the backspace key alas the fact that firefox on ubuntu isn’t as feature rich, so here a work around:

    Go to “about:config”, you know to inspect the sqllite db firefox stores everything in.
    `Filter` for ‘browser.backspace_action’ and change its value to 0 (zero).

     
  • webscriptz 14:12 on 07/11/2010 Permalink | Reply
    Tags: gnome, linux, mac, osx,   

    Ubuntu just go better 

    All my coding is done on linux, on the ubuntu distro which isn’t always that nice for portables i might add. Gnome bugs me much for it’s problem to properly control the brightness on my portable but apart from that it’s nice.

    Now, a team of developers has brought a mac osx like feature to ubuntu or gnome: gnome-do. check it out, install and enjoy:

    http://do.davebsd.com/index.shtml

     
  • webscriptz 21:01 on 18/10/2010 Permalink | Reply
    Tags: dock, , linux, nice things,   

    Ubuntu 10.10 has been released a few days ago and I found a few nice things to do with it: http://www.omgubuntu.co.uk/2010/10/customizing-ubuntu-10-10-with-a-dock-new-icon-theme-effects-global-menu-and-more/

     
  • webscriptz 10:46 on 21/03/2009 Permalink | Reply
    Tags: kernel, linux, map, transparent   

    Linux kernal map 

    Linux is a facinating OS but not always transparant to everybody, certainly the kernel has that problem. This linux map will help you figure out the linux kernel and has documentation and everything to it.

    Kernel Map

     
    • Hellen CLARK 20:06 on 23/03/2009 Permalink | Reply

      Nice website, I found you while looking for some blog related search and want to give you a compliment while I was here.

  • webscriptz 01:26 on 20/08/2008 Permalink | Reply
    Tags: lame, linux,   

    Ubuntu to lame 

    Now that I’m using Ubuntu 8.04 on my laptop as primary system, I had the chance to check out many things on it and it displeases me greatly. The bugs I found:

    1. Firefox is still running even if everything is closed
    2. Movie player crashes if you fast forward a bit
    3. emerald and compiz run with problems
    4. Less control over what you install rails is at version 2.1.x and I updated but still if I run
       Ruby | http://webscriptz.be/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/> copy code |? 
      1
      rails appname 

      and then

      firefox 0.0.0.0:3000

    I get rails version 2.0.2 and I already reinstalled ubuntu just for that

    Ubuntu has issues and if I can get gentoo running on my laptop I’ll change gladly. Unfortunantly gentoo has problems in virtualbox something with xorg server so I have to check that out.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel