Pragmatic Linux Server PLS

From Pragmatic Linux Wiki
Jump to: navigation, search


This document is a guide for installing Pragmatic Linux Server (PLS) with the official installation image. Before installing, it would be advised to view the FAQ.This document is a guide for installing Arch Linux from the live system booted with the official installation image.



Installation Process

Pragmatic Linux Server (PLS) is a 32 bit stable OS which offers all the neccessary benefits of a web server. The installation process is short (under 5 minutes) and not complicated.

System Requirments

CPU: 1 Core
RAM:80 MB (Recommanded change for yourself needs)
Disk Space: 1.3 GB
Internet Connection: Not Required (Optional for updates)
Virtualization Technology
Software Requirments: VirtualBox 5 or Newer

User Credentials Default

Username:root
Password:pragmatic

Username:pragmatic
Password:pragmatic

It can be used for project developing and is easy managable for a team because of the pre-installed environment that comes with it.

After you download and install VirtualBox 5 and Pragmatic Linux Server (PLS) latest version then you are right in path how to install it. Open virtualbox then click File > Import Appliance

Safe.png

click on folder icon and select downloaded pragmatic linux server.

Next Step click Next and the if you want to change name of machine click on field name and change to your project name,then just click import and wait until the import has been finished.

Details-virtualbox-appliance.png

Start Server

Open Virtualbox and click your machine how you named it and then click on button start at up side then wait until the machine its start. the machine will be ready in a minute. and then you cant start using service that offers.

List-vm.png

Shutdown server

The server will shutdown in a minute.

Select Machine Name -> Right Click -> Close -> ACPI Shutdown 

Vm-shutdown.png

Usage & Services

The Pragmatic Linux Server (PLS) offser many benefits as server:

Default Credential logins

As Root (Administrator)

Username: root
Password: pragmatic

As Normal User

Username: pragmatic
Password: pragmatic


HTTP (Apache)

Accessing the website via HTTP now its more easier, you have multiple choices how you want to access the website.

http://127.0.0.1/
http://localhost/
http://yourdomainname/

The basic directory for the apache and PHP is /srv/projects If you can connect to the server the service http is working perfectly. If you have skype opened , jump to this link #Port_Forwarding


Domain Name Virtual Host

Manage projects with pragmatic linux is an easy task, you handle multiple projects on instance server. There will be mentions some tips and trick that can be used. If you have an static ip for virtual machine or your windows Host IP then you can easily convert accessing to web from ipaddress to name. Configuring domain name for the many projects Example we have accessing them like http://127.0.0.1/project-laravel/public http://127.0.0.1/project1, its not very easy and useful for projects that requires domain. Using Domain we can develop the software like it was in real server.

Goal Transform the listed project URL


       FROM                                      TO                     Directory projects on server

http://127.0.0.1/project-laravel/public -> http://laravel.dev            /srv/proejcts/project-laravel

http://127.0.0.1/project-2              -> http://myapp                  /srv/projects/project-2

http://127.0.0.1/abcdefg                -> http://abcdefg                /srv/projects/abcdefg

Configure the Virtual Host in apache.

Connect with SSH Protocol on PLS. create new file in directory /srv/vhost/yourdomainname.conf for each projects is supposed to create new file.


FileName: /srv/vhost/laravel.dev.conf
###############################
## Laravel.dev Domain Configuration
###############################

<VirtualHost *:80>
      ServerAdmin yourmail@domain
      DocumentRoot "/srv/projects/projects-laravel/public"
      ServerName laravel.dev
</VirtualHost>
FileName: /srv/vhost/myapp.conf
###############################
## Project-2 MyApp Domain
###############################

<VirtualHost *:80>
      ServerAdmin yourmail@domain
      DocumentRoot "/srv/projects/project-2"
      ServerName myapp
</VirtualHost>
FileName: /srv/vhost/abcdefg.conf
###############################
## abcdefg abcdefg Domain
###############################

<VirtualHost *:80>
      ServerAdmin yourmail@domain
      DocumentRoot "/srv/projects/abcdefg"
      ServerName abcdefg
</VirtualHost>

The configuration on PLS its done. Nnow restart the service or to not bother anymore restart the PLS Machine. We need to configure the hostname of the Host OS.


If you have an static ip for virtual machine or your windows Host IP then you can easily convert accessing to web from ipaddress to name.

Modifying your hosts file enables you to override the DNS for a domain, on that particular machine. This is useful when you want to test your site without the test link, prior to going live with SSL, verify that an alias works, prior to DNS changes and for other DNS releated reasons. Modifying your hosts file causes your local machine to look directly at the IP address specified.

Add two new entries at host files

Windows

  1. Press the Windows key.
  2. Type Notepad in the search field
  3. In the search results, right-click Notepad and select Run as administrator
  4. From Notepad, open the following file C:\Windows\System32\Drivers\etc\hosts
  5. Add new line at the end of file So in our case i am using 127.0.0.1, you can use your external ip.
    
    127.0.0.1        laravel.dev 
    127.0.0.1        myapp
    127.0.0.1        abcdefg 
    
    
  6. Click File > Save

Ready to connect with domain name via web-browser

http://laravel.dev/

http://myapp/

http://abcdefg/

Linux

  1. Open terminal, login as root or use sudo
  2. sudo nano /etc/hosts
  3. add the line:
    127.0.0.1        laravel.dev 
    127.0.0.1        myapp
    127.0.0.1        abcdefg 
    
  4. CTRL+X > Y > Enter

Ready to connect with domain name via web-browser

http://laravel.dev/

http://myapp/

http://abcdefg/

FTP - File Transfer

FTP stands for "File Transfer Protocol" FTP powers one of the fundamental Internet functions and is the prescribed method for the transfer of files between computers. It is also the easiest and most secure way to exchange files over the Internet.

We use FTP Service to connect to server and exchange file over it.We use FileZilla in our case. https://filezilla-project.org/download.php

After you download and finish installation of FileZilla, open it and enter your ip Address that you get from Command Line. In our case we are having 192.168.0.104 this can be different in your computer.

Username: pragmatic
Password: pragmatic

Now try to connect to server and you will folders. So when you upload something on folder projects you will directly access it from http://ip-addresse/filename

MySQL Database

MySQL is used to store data, many software todays have database so its necessary to have it.

Pragmatic Linux Server (PLS) offers mysql service, with phpMyAdmin Web Interface, you can use also MySQL Workbench, or different way. Which ever fit to you use it here we will describe the way of connecting to mysql server directly to server.

Credentials

Username: pragmatic
Password: pragmatic

MySQL Server

# mysql -u root -p
# Enter Password:

MariaDB [(none)]> 

phpMyAdmin

In Web Browser write http://youripaddresse/phpmyadmin you can manage all database via this tool web interface.

Phpmyadmin.png


SSH Protocol

Secure Shell SSH sometimes known as Secure Shell, is a UNIX-based command interface and protocol for securely getting access to a remote computer. It is widely used by network administrators to control Server and other kinds of services remotely.

Windows

Connect to server via SSH Client, we suggest to use putty

https://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

If you are asked for key fingerprint click yes, then you will be asked for login.

Username: pragmatic
Password: pragamtic

IP:127.0.0.1 or what ever ip you have on your machine Ssh-putty.png Pragamtic-ssh.png

Linux

# ssh pragmatic@127.0.0.1

Port Forwarding

Port Forwarding its important thing and its need to be managed good to portforward any service from port 80 > 81 thats requires to configure virtualbox machine.

So i will take on example if you have skype running the default port 80 is taken by skype, and it will block for virtual machine to access it via ipadress:80, one port can be used for one service not for many. So we need to change it from port 80 to different port in this case we are heading it to port 81 if this isnt taken by any another software. Changing default port forward it will affect us how we access to the services Example, HTTP default is 80, so we will portforward to 81 http://localhost:81. this is usable also if you runn multiple instance of Pragmatic Linux Server (PLS). Lets get ahead at practice.

Go to virtualbox and double click on your machine name and go to menu Machine -> Settings -> Network -> Adapter 1 -> Port Forwarding Portforward.png

Column Host Port is your Host OS Windows, Linux, Mac, etc Guest Port is Pragmatic Linux Server internal port(No need to change anything on this column), Change the row with name HTTP Host Port from 80 > 81, careful dont touch Guest Port let it as it is.

Click Ok, Port Forwarding is done, now we can connect to the server HTTP Service via

http://youripaddress:81/

More information about configuring Port Forwarding.


Change Logs Version

Pragmatic Linux Server Version, are listed below and changes betwen them Change Logs Version