Selamat datang di blog saya "YENDRA84 ---- MARI MENCARI ILMU BERMANFAAT"

Rabu, 21 November 2012

ubuntu (Setting Up Name Based Virtual Hosting )

Setting Up Name Based Virtual Hosting

I do apologize again for some of the recent downtime on the blog. I’ve been researching tuning options all evening to try to bring the memory consumption lower. I did also add an additionl 256M RAM to the machine hoping that will help. Thanks for the patience during this bumpy ride.
I wanted to put down some of my notes concerning configuring Apache2 with virtual hosts for hosting multiple sites. This is something I have done quite a bit before but had a little trouble on this last setup. So in an attempt to better document my steps here is what I did.
Installing Apache 2
I’ll be discussing name based virtual hosting with Apache (Apache 2 to be specific). We’ll need to install that before we dive in:
sudo aptitude install apache2
Once these are setup you should be able to connect to localhost in your browser and see a test page.
NameVirtualHost
With the default configuration you are only serving up one site, and that site is based on your IP address. What I’m setting up is name-based virtual hosting, meaning the Apache server will serve specific content based on the domain name requested. In this way a single server can host multiple sites, and serve up unique content based on the domain requested.
My preferred method of using name based virtual hosting is creating a seperate file for each domain. These can all be done within one file, but I’ll be creating a new file for each site.
First we need to define to Apache that we’re using name based virtual hosting instead of IP based. You can append the following line to your /etc/apache2/apache2.conf to define this:
NameVirtualHost ip.address:port
The above should be your public facing IP address (assuming you’re creating a public site), and port is generally port 80 by default. After this we’ll create the base configuration for your virtual hosts. Debian and Ubuntu use /etc/apache2/sites-available/ and /etc/apache2/sites-enabled/ directories for defining virtual hosting. One nice thing about this is that you can have more sites “available” than you have “enabled”, meaning not everything configured is actually live and listening. This is nice to quickly disable a site for whatever reason.
I like to create unique files for each of my domains within the /etc/apache2/sites-available/ folder. For example I have a file called “ubuntu-tutorials.com” in that directory, with the following contents:
<VirtualHost 67.207.131.28:80>
ServerName ubuntu-tutorials.com
ServerAlias www.ubuntu-tutorials.com
ServerAdmin christer.edwards@ubuntu.com
DocumentRoot /var/www/ubuntu-tutorials.com/html
</VirtualHost>
What these settings do is as follows:
  • ServerName listens for requests asking for a certain domain
  • ServerAlias defines any additional domains that should match
  • ServerAdmin is the contact for the site
  • DocumentRoot is the path to the content for that site
Now that this file is created in the /etc/apache2/sites-available/ folder we’re just about ready to start, but we need to enable it. We can do that by creating a symbolic link from one folder to the next.
cd /etc/apache2/sites-enabled/
ln -s ../sites-available/ubuntu-tutorials.com .
This site is now available (as in configured) and enabled (as in listening) once we restart the apache service:
sudo /etc/init.d/apache2 restart
Testing
To test your configuration you can, temporarily, configure your /etc/hosts file to point the domain to your IP address and see if your server loads up the correct site. This is only needed if the hostname or domain name does not already resolve to your IP address. Editing the /etc/hosts by adding the following line:
ip.address domain.tld
Open your browser, try to access domain.tld and see if it loads the contents from your local DocumentRoot (from the configuration above). You might want to drop a file in the DocumentRoot to verify its pulling your local content.
cd /var/www/ubuntu-tutorials.com/html
echo "Hello World" > index.html
Conclusion
I hope I didn’t miss anything here. One of the main purposes of this writeup is to document what I did to setup my server. I do it so rarely I don’t always remember all the steps when I need to. If this helps you setup name based virtual hosting, great. Leave a comment and let me know. If I forgot anything critical please also let me know so I can update the contents.

WEB server Apache pada Ubuntu

Server web adalah sebuah perangkat lunak server yang berfungsi menerima permintaan HTTP atau HTTPS dari klien yang dikenal dengan browser web dan mengirimkan kembali hasilnya dalam bentuk halaman-halaman web yang umumnya berbentuk dokumen HTML. Server web yang terkenal diantaranya adalah Apache dan Microsoft Internet Information Service (IIS). Apache merupakan server web antar-platform, sedangkan IIS hanya dapat beroperasi di sistem operasi Windows.

untuk cara instalasinya bisa di pahami dibawah ini:
Pertama instal dulu web server apache
# sudo apt-get install apache2




kedua install database server
# sudo apt-get install mysql-server

kemudian install php untuk apache
# sudo apt-get install php5

atau melalui  sudo dpkg -i /[lokasi kumpulan file deb]/*.deb secara offline dari apt web yang menyediakan apache




selanjutnya install mysql untuk apache
# apt-get install libapache-mod-acct-mysql
# apt-get install php5-mysql

sebagai tambahan juga silahkan tes terlebih dahulu apakah webserver yang telah temen-temen buat tadi sukses atau tidak dengan cara ketikkan alamat di browsernya :

http://localhost

jika telah tampil tulisan “it work“, berarti instalasi yang baru saja temen-temen lakukan telah berhasil dan untuk htdoc di linux adalah :

/ var / www /

lanjutkan ke konfigurasi htdoc nya... dan setting lainnya

Minggu, 11 November 2012

install aplikasi wine secara offline di ubuntu


Misalnya kita ingin menginstall aplikasi wine secara offline, maka setelah masuk ke website http://apt-web.dahsy.at/ atau di  apt-web  lainnya akan ada tampilan seperti di bawah ini :

 



Pertama, kita pilih Base distribution yang cocok dengan versi Ubuntu yang kita gunakan. Kemudian pilih Mirror terdekat dengan lokasi kita. Selanjutnya ketikkan aplikasi yang kita inginkan (yaitu wine) pada isian Packages, kemudian klik submit. Maka anda akan mendapatkan tampilan seperti di bawah ini :

 

Langkah selanjutnya adalah download semua file (.deb) yang ada hasil dari langkah sebelumnya, kemudian simpan pada lokasi tertentu di komputer anda.

2. Ketikkan perintah berikut di terminal:
sudo dpkg -i lokasi/folder/*.deb
Perintah di atas akan menginstall semua file-file dari aplikasi yang kita inginkan.
Demikian artikel Instalasi aplikasi di Ubuntu Secara Offline ini, semoga bermanfaat.