Logo Background RSS

» http

  • Stop Coredump file
    By on March 23rd, 2009 | 10 Comments10 Comments Comments

    Many webmasters ask me how to stop core dump files in Apache.. Now today i will tell you how to stop core dump file in apache.  This is basically happens when System Crashes it makes a coredump file in the public_html Directory.

    The possible reason for the core files getting generated is when a php process is killed, apache creates core files under your account .

    On phpSuexec servers this may cause due to incorrect php.ini file placed in your account and if it is caused due to php/apache then you can get rid off those core files by editing the httpd startup file on the server end .

    Lets start

    Code:
    root@server [~]# vi /etc/init.d/httpd

    Search for ulimit lines .For eg : you can see these lines

    Code:
    ulimit -n 1024
    ulimit -n 4096
    ulimit -n 8192
    ulimit -n 16384

    You need to add ulimit -c 0 at the end .Which will look like :

    Code:
    ulimit -n 1024
    ulimit -n 4096
    ulimit -n 8192
    ulimit -n 16384
    ulimit -c 0

    root@server [~]# :wq

    Save changes and quit.
    Now kill / stop apache service and then start apache service on the server .

    Code:
    root@server [~]# service httpd stop
    root@server [~]# service httpd stop
    httpd (no pid file) not running
    root@server [~]# service httpd startssl
    root@server [~]# service httpd startssl
    httpd (pid 21154) already running

    Finished :D

    It works most of the OS.

    Self tested on CENTOS 5.2 i686 on standard

  • How to use SSH Via HTTP Proxy using Corkscrew in Ubuntu
    By on October 30th, 2008 | 1 Comment1 Comment Comments

    If you want to ssh your vps server or your home computer from your work place (assuming you are using http proxy).You need to use Corkscrew.

    corkscrew is a simple tool to tunnel TCP connections through an HTTP proxy supporting the CONNECT method. It reads stdin and writes to stdout during the connection, just like netcat.

    It can be used for instance to connect to an SSH server running on a remote 443 port through a strict HTTPS proxy.

    Install corkscrew in ubuntu using the following command

    sudo aptitude install corkscrew

    This will complete the installation.

    Configue corkscrew

    If your HTTP proxy uses authentication, then you’ll need to tell it about the username and password to use This is where the concept of ‘auth-file’ comes into play. All you have to do is put your username & password, separated by a colon, into a textfile. Once you’ve done this, you just have to tell corkscrew where to find the auth-file. Create a file called .corkscrew-auth in your home directory

    $touch .corkscrew-auth

    $gedit .corkscrew-auth

    and place your username and password in the following format

    username:password

    Save and exit the file.

    Configure ssh For Tunneling

    Now we’ll tell ssh what to do when connecting to all or specific hosts. Open up ~/.ssh/config (that’s /home/yourusername/.ssh/config) in your favourite text editor (gedit,nano,vim etc)

    $gedit /home/yourusername/.ssh/config

    and add the following lines

    Host *

    ProxyCommand corkscrew proxyhostname proxyport %h %p /home/username/.corkscrew-auth

    Save and exit the file

    Note: replace proxyhostname and proxyport with the equivalents for your network.

    Note: you won’t need to add the last section, ‘/home/username/.corkscrew-auth’, if your HTTP proxy doesn’t use authentication.

    What we’ve just told ssh to do is for all hostnames (’Host *’), use the following proxy command to route the connection.If you want more secure connections you can also list of hosts.

    Corkscrew Syntax

    corkscrew proxy proxyport targethost targetport [ authfile ]

    proxy – This is the name of the host running the HTTP proxy.

    proxyport – This is the port on which to connect on the proxy.

    target – This is the host to reach through the proxy.

    targetport – This is the port to connect to on the target host.

    Test your SSH connection

    ssh serverip

  • HTTP download proxy for software packages
    By on October 30th, 2008 | 1 Comment1 Comment Comments

    Apt-Cacher-ng is a software package that keeps a cache, on the disk, of Debian/Ubuntu Packages and Release files.When an apt-get like client issues a request for a file, Apt-Cacher intercepts it and if the file is already cached it serves it to the client immediately, otherwise it fetches the file from the Internet, saves it on the cache, and then serves it to the client. This means that several Debian machines can be upgraded but each package need to be downloaded only once.

    Apt-Cacher-NG does not require neither an interpreter, nor a web server and not even a huge runtime library. It does never fork after server startup, it does not create flag files, flock() files or similar fun. Instead, it uses native system functions (mmap, sendfile) to operate with few overhead.

    Apt-cacher-ng caches the repo’s from the different versions of ubuntu quite nicely. It even nicely supports the different installs of intrepid in my home with different personal package archives (PPA, you know as in ppa.launchpad.net/*).

    Install Apt-Cacher-NG in Ubuntu Intrepid

    First you need to download the latest version of Apt-Cacher-NG from here or using the following command

    wget http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/apt-cacher-ng_0.3.3-1_i386.deb

    Install .deb package using the following command

    sudo dpkg -i apt-cacher-ng_0.3.3-1_i386.deb

    or you can use the following command to install

    sudo apt-get install apt-cacher-ng

    Now you need to Add a proxy entry to the apt system

    Configure the apt system (apt-get, aptitude, etc.) to use apt-cacher-ng

    $ echo ‘Acquire::http { Proxy “http://localhost:3142″; };’ | sudo tee /etc/apt/apt.conf.d/01proxy

    Run the following command if you need to disable it

    sudo rm /etc/apt/apt.conf.d/01proxy

    Add a proxy entry to the Synaptic system for this go to: Settings->Preferences->Network->Manual Proxy Configuration and enter

    HTTP Proxy: localhost 3142

    FTP Proxy: localhost 3142

    Click OK

    Click Reload

    Dashboard & manual

    For apt-cacher-ng dashboard use the following URL

    http://localhost:3142/acng-report.html

    For apt-cacher-ng manual: (right click &) open with your browser

    file:///usr/share/doc/apt-cacher-ng/html/index.html

    Import .deb files from the local apt cache

    apt-cacher-ng use the .deb files that are already in /var/cache/apt/archives/

    sudo mkdir -p /var/cache/apt-cacher-ng/_import

    sudo chown apt-cacher-ng /var/cache/apt-cacher-ng/_import

    Now open browser using the following URL

    http://localhost:3142/acng-report.html

    and click “Start Import”

    Configure Client Machines

    If you want to use apt-cache-ng in ubuntu or debian clients use the following command to use this proxy

    $ echo ‘Acquire::http { Proxy “http://serverip:3142″; };’ | sudo tee /etc/apt/apt.conf.d/01proxy