CyberKeeda In Social Media
Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Host your website or application on Internet using ngrok.

Ngrok


Ngrok, yet another ultimate free open source and cross-platform reverse proxy server for exposing local servers behind NATs and firewalls Internet over secure tunnels. 


It essentially establishes secure tunnels to your local hosted server that allows us to run demos of web sites before actual deployment, testing mobile apps connected to your locally running backend and building web-hook consumers on your development machine.


Use Case : Are you looking for a ready to go and secure solution to showcase your website or application which is behind NAT gateways or firewall to public facing internet, Ngrok is the way to go ahead.

Lets know, how to install, configure and use it.

Installation.


Installation is pretty much simple and straight, download , unzip and yes you are done.

[root@CKcentos01x ~]# mkdir /usr/local/ngrok

[root@CKcentos01x ~]# cd /usr/local/ngrok

[root@CKcentos01x ~]# wget -c https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip

[root@CKcentos01x ~]# unzip ngrok-stable-linux-amd64.zip

And yes you are done, we are ready to use it.

Lab setup : We have our demo website hosted within our local virtual machine behind NAT network with an IP of 192.168.106.133

We will access the website from Internet after application of ngrok.

Here is how our website looks like.




Now using ngrok, we will host the same website using ngrok's secure tunnel on internet.

Note : Our website is hosted on Apache Webserver on port 80

[root@CKcentos01x ~]# cd /usr/local/ngrok
[root@CKcentos01x ~]# ./ngrok http 80



Our server has been hosted using ngrok secure tunnel, we can access using any of forwarding URL provided by ngrok.

One easy way to inspect the traffic is using the ngrok UI, let's access it.

http://localhost:4040 

We can access it from our local host only and use any one of the URL to access our demo website from internet.



Even we can use ngrok to see stats too.








 
I hope ngrok's above guide looks informative to you, do comment !
Read more ...

An introduction to Dashing and Smashing dashboard frameworks


Dashing

The exceptionally handsome dashboard framework in Ruby and Coffeescript.

You can go through the slide to have a intro about it.




Read more ...

nagios 4.0.8 fails to start with "Error:




nagios 4.0.8 fails to start with "Error: Failed to initialize query handler" (bind() failed: No such file or directory)

qh: Failed to init socket '/usr/local/nagios/var/rw/nagios.qh'. bind() failed: No such file or directory

error: Failed to initialize query handler. Aborting


Nagios Core responds me these errors while starting nagios.

Fix : Error itself give us an hint about no directory error, hence leading to failure while starting  the service.

Fix:  To fix this issue I will create the missing directory manually and aligning permissions to it.



  • Depending upon your error of missing directory create it.

cybeerkeeda@Linux-Maniac:~ mkdir -p  /usr/local/nagios/var/rw/
  • Provide full permission to it.
cybeerkeeda@Linux-Maniac:~ chmod -R 777  /usr/local/nagios/var/rw/
  • Restart Nagios again
cybeerkeeda@Linux-Maniac:~ sudo service nagios restart




Read more ...

Owncloud : Unable to change Max Upload size




Increase File Upload Size from default admin pannel.

Go to File handling --  Change Upload size.


Chnage it's value from 2 to something as per your requirement.

Now save -- Login as a normal user after 5 Min and then check back again.
If all seems good then.. this tutorial is just got an ending for you.


If not, just dig into some files.

I have tried to change it from 2 to 8 MB , but even after saving it didn't went well.

Locate your  owncloud root folder, wherever you have kept it, i have my owncloud folder under /var/www/html/owncloud and open the file .htaccess

cybeerkeeda@Linux-Maniac:~ vim /var/www/html/owncloud/.htaccess
cybeerkeeda@Linux-Maniac:~ vim .htaccess
You must find the updated value within the two lines, if not change it do the desired value but remember both must be of same value ( like i have taken limit as 8 MB )

 php_value upload_max_filesize 8M
 php_value post_max_size 8M


Save and restart webserver 


cybecybeerkeeda@Linux-Maniac:~ service httpd restart
cyberkeeda@Linux-Maniac:~ systemctl restart httpd
Now, check again it should work.

Till now, if it's not working for you locate the default php.ini file , find and update the same value over there too.


cybeerkeeda@Linux-Maniac:~ locate php.ini
cybeerkeeda@Linux-Maniac:~ vim php.ini

upload_max_filesize = 8M

post_max_size = 8M


Restart your web server again and check, it must be working.

Now you can upload file size more then default value.
Read more ...

How to enable Microsoft Word support on OwnCloud



This tutorial will guide to enable Microsoft / LibreOffice/OpenOffice Word document Online view on browser.


Install Libreoffice package on Owncloud server
cybeerkeeda@Linux-Maniac:~ yum install libreoffice*
cybeerkeeda@Linux-Maniac:~ yum install libreoffice-headless
cybeerkeeda@Linux-Maniac:~ yum install libreoffice-impress

These are the mandatory packages that are supposed to be installed within your Owncloud Server

Now Enable Documents from the App window



Check within your config.php file ( owncloud/config/config.php ), if the below mentioned line has been added or not
if not then add it manually
'preview_libreoffice_path' => '/usr/bin/libreoffice',

Now Again Click on Admin -- Documents -- Local - Apply and Test

Now confirm it from the below similar looking pic

You must be able to View the Document within your browser.

Read more ...

Varnish Cache Server Configuration





Varnish is now installed under the /usr/local directory.
The full path to the main binary is /usr/local/sbin/varnishd.
The default configuration file is /usr/local/etc/varnish/default.vcl.



You can start Varnish by running the varnishd binary. Before you can do that though, you have to tell Varnish which back-end server it's caching for. Let's specify the back end in the default.vcl file. Edit the default.vcl file as shown below, substituting the values for those of your Web server:

Note -:  Important is 1st to Change your Apache's http.conf  Listen port to 8080 

I assume varnishd is in your path. You might want to run pkill varnishd to make sure varnishd isn't running. Become root and type:


[root@cyberkeeda etc]# vim /usr/local/etc/varnish/default.vcl

 backend default {
     .host = "127.0.0.1";
     .port = "8080";
 }

# pkill varnishd

Now you can start Varnish with this command:

[root@cyberkeeda etc]# /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -a :6081 -P /var/run/varnish.pid -s malloc,256m

Here Apache is using Varnish Cache using port 6081 -- http:/localhost:6081

The moment you want to move it under production replace it by port 80

# pkill varnishd

[root@cyberkeeda etc]# /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -a :80 -P /var/run/varnish.pid -s malloc,256m

Now you can directly open --: http://localhost


If you installed Varnish from your package manager, it may be running already. In that case, you can stop it first, then use the command above to start it manually. Otherwise, the options it was started with may differ from those in this example. A quick way to see if Varnish is running and what options it was given is with the pgrep command:

/usr/bin/pgrep -lf varnish
Varnish now will relay any requests it receives to the back end you specified, possibly cache the response, and deliver the response back to the client. Let's submit some simple GET requests and see what Varnish does. First, run these two commands on separate terminals:

/usr/local/bin/varnishlog
/usr/local/bin/varnishstat

To view communication between Varnish and the client (omitting the back end):

/usr/local/bin/varnishlog -c
To view communication between Varnish and the back end (omitting the client):

/usr/local/bin/varnishlog -b
To view the headers received by Varnish (both the client's request headers and the back end's response headers):

/usr/local/bin/varnishlog -i RxHeader
Same thing, but limited to just the client's request headers:

/usr/local/bin/varnishlog -c -i RxHeader
Same thing, but limited to just the back end's response headers:

/usr/local/bin/varnishlog -b -i RxHeader
To write all log messages to the /var/log/varnish.log file and dæmonize:

/usr/local/bin/varnishlog -Dw /var/log/varnish.log
To read and display all log messages from the /var/log/varnish.log file:

/usr/local/bin/varnishlog -r /var/log/varnish.log

Read more ...
Designed By Jackuna