23 October 2013

Install Web Server di Ubuntu

Mungkin sebagian dari anda semua pada tau bagaimana membuat web server di Ubuntu, tapi ada baiknya saya posting disini karena kedepannya saya berharap ada yg bikin tutorial beberapa aplikasi yg berbasis web macam ERP, cloud computing dll. Jadi Thread ini bisa jadi patokan, Amiin...

Ana asumsikan kompi terhubung ke inet atau repo lokal via cd atau LAN.

buka terminal, install beberapa paket ini :

sudo apt-get install apache2

test apakah web server sudah terinstal dengan baik dengan cara buka browser anda dan ketikkan localhost

kalau muncul halaman seperti ini, berarti web server anda sudah bekerja dengan baik...



selanjutnya...

sudo apt-get install php5

sudo apt-get install mysql-server

sudo apt-get install phpmyadmin

Khusus untuk instalasi mysql anda akan ditanya user dan password administrator root mysql yg akan anda gunakan nanti (user dan password terserah anda, yg penting di ingat ya Sob).

sedangkan paket phpmysql digunakan untuk editor mysql via web jadi bagi yg alergi dengan syntax sql di konsole bisa gunain fitur ini. Untuk aksesnya silahkan buka browser ketik localhost/phpmyadmin masukkan user dan password root mysql yg sudah dibuat sewaktu installasi mysql Wink

Kebanyakan penempatan file-file web dicemplungin di /var/www atau /usr/share. Tapi banyak aplikasi web di porting ke server akibatnya direktori root jadi bengkak, ngakalinnya bisa dengan menggaktifkan modul user dir di kernel. Maksudnya biar konten web bisa dialihin ke direktori user di /home/user/public_html. caranya...

sudo a2enmod userdir

kemudian restart web server anda dengan mengetik dikonsole

sudo /etc/init.d/apache2 restart

buat direktori di /home/user/public_html

coba test dengan membuka browser anda kemudian ketik :

http://localhost/~user

jangan lupa tanda "~" didepan nama user anda exp :/localhost/~novalnd
apabila tidak ada masalah, tampilannya akan seperti gambar berikut :




dengan cara ini anda dapat berbagi web aplikasi dengan sesama user yg terhubung dengan anda via jaringan.

selanjutnya, kita tinggal implementasi web aplikasi yg pengen kita pasang. Bagi para web developement bisa menggunakan fitur ini untuk melihat tampilan webnya secara real, kalo fix tinggal di upload ke hostserver di inet

selamat mencoba


 #langkahnya
-----------
Kemudian extract paket XAMPP:
sinux3r@us3r-l0s3:~$ sudo tar -zxvf xampp-linux-1.7.tar.gz -C /opt

Membuat shortcut XAMPP pada Start Menu:
sinux3r@us3r-l0s3:~$ cd ~/.local/share/applications

Buat file dengan text editor kesukaan anda(nano,gedit,pico,dll) saya gunakan GEDIT .. :P, ketikkan perintah berikut:
sinux3r@us3r-l0s3:~$ gedit xampp-control-panel.desktop

Silahkan kopas code berikut ke dalam file tersebut:

[Desktop Entry]
Comment=Start/Stop XAMPP
Name=XAMPP Control Panel
Exec=gksudo /opt/lampp/share/xampp-control-panel/xampp-control-panel
Icon[en_CA]=/opt/lampp/htdocs/favicon.ico
Encoding=UTF-8
Terminal=false
Name[en_CA]=XAMPP Control Panel
Comment[en_CA]=Start/Stop XAMPP
Type=Application
Icon=/opt/lampp/htdocs/favico.ico

Simpan dan keluar editor.

Untuk publikasi dokumen HTML:
XAMPP menggunakan /opt/lampp/htdocs sebagai ROOT direktory, tapi kita juga dapat membuat direktori publikasi dokumen pada user kita (tidak pada ROOT).
Ikuti langkahnya:

sinux3r@us3r-l0s3:~$ cd ~
sinux3r@us3r-l0s3:~$ mkdir public_html
sinux3r@us3r-l0s3:~$ sudo ln -s ~/public_html /opt/lampp/htdocs/$USER

NB:Pada script "$USER", berikan nama sesuai nama user account yang anda gunakan, dalam hal ini saya menggunakan nama saya sendiri laugh.

sinux3r@us3r-l0s3:~$ sudo ln -s ~/public_html /opt/lampp/htdocs/sinux3r

Sekarang semua file atau dokumen yang ada pada ~/public_html, akan ditampilkan oleh webserver.

Memulai XAMPP / menjalankan layanan atau service:

sinux3r@us3r-l0s3:~$ cd /opt/lampp
sinux3r@us3r-l0s3:~$ sudo ./lampp start


atau dapat diakses dari XAMPP Control Panel yang telah kita buat tadi:

sinux3r@us3r-l0s3:~$ Applications -> Lainnya -> XAMPP Control Panel


Sebagai defaultnya PHP5, tetapi kita juga dapat menggunakan PHP yang lain jika kita inginkan:

sinux3r@us3r-l0s3:~$ cd /opt/lampp
sinux3r@us3r-l0s3:~$ sudo ./lampp php4
sinux3r@us3r-l0s3:~$ sudo ./lampp php5


Buka webbrowser dan ketikkan:

http://localhost/usernameanda/

ex: http://localhost/sinux3r

Sekuriti / keamanan:

http://apachefriends.org/xampp-linux/381


Untuk mengkonfigurasi keamanan pada XAMPP:

sinux3r@us3r-l0s3:~$ cd /opt/lampp
sinux3r@us3r-l0s3:~$ sudo ./lampp security


XAMPP dan LAMPP tidak dapat berjalan sementara waktu. untuk mengatasinya kita STOP dahulu servicenya dan kita START lagi agar berjalan normal.

catatan:
~/public_html sama dengan /home/sinux3r/public_html/ dimana lokasi folder public_html berada.
sumber: http://fitri-ariyanto.blogspot.com/2009/01/install-xampp-in-ubuntu-linux.html


Ubuntu LAMP server Install the following Versions
Ubuntu 12.10 (Quantal)
Apache 2.2.22
Mysql 5.5.27
PHP 5.4.6
First you need to download server version of Ubuntu version from here after that create a CD and start booting with the CD Once it starts booting you should see the following screen in this you need to select your language and press enter

Now you need to select “Install Ubuntu Server” and press enter

Select your language and press enter

Select your location and press enter

If you want to try to have your keyboard layout detected by pressing a series of keys you need to select yes option.If you want to choose from a list click no

Select Origin of keyboard and press enter

Select keyboard layout and press enter

Detecting hardware to find CD-ROM Drivers in progress

Loading additional components in progress

Configures the network with DHCP if there is a DHCP server in your network

Enter your server Hostname

You need enter the Full name of the user you want to create for your server in this example i have created ubuntu user select continue and press enter

Enter your user account name here

Entered the password for ubuntu user select continue and press enter

Confirm password for ubuntu user

If you want to configure encrypted private directory select yes otherwise no and press enter

Configuring clock option

Detecting disks and all other hardware

You have to partition your hard disk in this example i have selected use entire disk option.If you want to do manually you can choose manual option and press enter.Make sure you have swap partition in place

Warning message about data lost on your hard disk

Guided Partitioning

Write the changes to disk here you need to select yes and press enter

Creating ext4 file system in progress

Installing  system in progress

Configuring the package manager select continue and press enter

Configuring package mirror this will be related to your country option

Select and install software in progress

Select how do you want to configure automatic update press enter

Now it will start Installing software and here you need to select the server options here i have selected as openssh server and LAMP server installation.If you want to select each package separately select "Manual package selection" option

At the time of software installation it will prompt for mysql server root password enter root password of your choice and select continue

Confirm mysql server root password and select continue

Software installation is in progress

Installing GRUB Boot loader in progress


Finishing installation in Progress

Installation complete message here you need to remove your CD select continue and press enter it will reboot your server

After rebooting your server it will prompt for username and password once you logged in you should see similar to the following screen

This will complete the Ubuntu 12.10 (Quantal) LAMP Server Installation and your server is ready for installing applications which supports apache,mysql and php.
Configuring Static ip address in Ubuntu server setelah instal ubuntu server
If you want to install vim editor use the following command
sudo apt-get install vim
Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit
Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):
sudo vi /etc/network/interfaces
and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit)
# The primary network interface
auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1


sumber: http://www.ubuntugeek.com/
Previous Post
Next Post
Related Posts

0 komentar: