Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Monday, May 30, 2016

ERROR: Target id 'android-xx' is not valid. Use 'android list targets' to get the target ids | Buildozer | Ubuntu


ERROR:
Target id 'android-xx' is not valid. Use 'android list targets' to get the target ids.
...
...
...
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

SOLUTION:

  1. Upgrade ant that is linked to Buildozer
  2. Install using sudo apt-get install ant.
  3. If ant is already installed and it is latest, just change the version in specification file of buildozer by following this link.




If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

ANT version change | Buildozer | Ubuntu



  1. Type which ant in terminal. 
  2. Mine resulted with /usr/bin/ant. If apache ant is not installed already, you might get an error.
  3. Uncomment #android.ant_path = line in buildozer.spec
  4. use android.ant_path = /usr/bin/ant 
  5. Now you can control the upgrades of ant and get it updated in buildozer automatically. Otherwise, there will be two instances (can be two different versions) in same machine.




If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Sunday, October 20, 2013

[How to] Configure Apache for clean URLs


In Ubuntu, after installing apache2


  1. Open terminal and type a2enmod rewrite hit enter
  2. Type /etc/init.d/apache2 restart  and hit enter.
  3. Type chmod -R 777 /var/www and hit enter






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Friday, May 18, 2012

How to release a service running on some port and assign new task in Ubuntu?

I have been running some service on my port 8080 and then tried to install Apache Tomcat server on the same port. It doesn't show me any output related to new installation when checked in the URL http://localhost:8080/ . The service that is already running on my 8080 port is not at all necessary for me. So I decided to kill it. Below are the steps.

1) Check the Process ID (PID) of the unwanted service running on 8080 by issuing the following command.


sudo fuser -n tcp 8080


2) It replies the PID of the service if it is running currently.

For example : 8080/tcp: 3660 in my case
Kill it by issuing the following command.


sudo kill 3660

3) Now assign your new service i.e Apache Tomcat server restart in my case. Thats it! It works ! :)



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

No JDK found - please set JAVA_HOME error while starting Apache tomcat in ubuntu

If you have already installed JDK and JRE in your system and encountered this error, then follow below steps.

1) Type sudo gedit ~/.bashrc in the terminal
2) Add export JAVA_HOME=/usr/lib/jvm/java-7-oracle  at the end of the file.  Here the path may vary depending upon your installation.  Open /usr/lib/jvm and check for the folder name and replace accordingly.  It is java-7-oracle in my case. This is nothing but setting up environmental path for java.


Check out if your Apache tomcat is starting.  If the same error encounters again, goto next step

3) Type sudo gedit /etc/default/tomcat6  in the terminal and hit enter.
( Type password if asked ).
4) Search for the word something similar to this JAVA_HOME=/usr/lib/jvm/java-7-oracle
If this line is commented, uncomment it and give the same path which you have given previously in .bashrc file.
5) Save the file and try to start the server again. It works!



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Thursday, October 13, 2011

Obfuscating PHP

Obfuscation is not the most effective way of security and at most of the times, it doesn’t help, as a professional hacker would already know these modifications and can easily make out what you are trying to hide. But obfuscation would really slow down the attacker and will keep away some script kiddies. It is better to obfuscate than rather telling him what he wants.

As an example - Server may use vulnerable version of PHP, with a public exploit released at some underground markets, Most of the time a simple automated exploit is released to help the “Point-Click-Hackers” (Script Kiddies). Now all they have to find is which Version of PHP you are using and if it is vulnerable, Point the exploit, launch it and own your system. In these cases obfuscating can really help you a lot.

By PHP obfuscation you can hide PHP, Which means you can stop or slow down a hacker attacking your machine.


In this tutorial, we’ll be looking at some of the most popular methods used by Site Administrators to Hide PHP , So let’s get started.

Editing php.ini file



PHP as a default exposes the fact that if it is installed on a server or not, by adding its signature to the Web server header which can really be lethal in some cases.

To set this off , Simply go to your php installation directory under “conf_files” , you can find your standard PHP Configuration file named “php.ini”

Now under this file , go to the “Miscellaneous” section and simply turn expose_php to Off.

Spoofing



By adding a simple line of code you can actually fool an attacker about what service are you using.

Spoof.php


Code:

<?php
error_reporting(0);
header("X-Powered-By: My Programming Language");
?>
Note: The header call should be made before you send any data to the client.

Using Some Basic Apache Rules



Most Web servers like Apache etc. Can be configured to use some basic rules that would allow to parse different file-types with PHP.

EG:-

A file like index.php, gives a straight clue to the attacker that the server is using php. But if we can use some basic server configuration to actually allow a extension like “.mpl” etc to parse PHP code. The attacker will certainly have no clue about the file extension.

For the Scope of this tutorial I’ll only be covering some Apache Rules/Configurations, but if you need help with some other servers, feel free to comment or PM me.

The configurations can be added either using the .htaccess directive or directly through the Apache Configurations file. Just add the following set of rules

Syntax :-
Code:

AddType application/x-httpd-php .extenstion
Example :-
Code:

AddType application/x-httpd-php .mpl .mp3 .py .asp
Note : Only use those extensions which are normally not used by the server , for example don’t use .txt extension as the server will interpret .txt as PHP code and if it contains some php , it will be executed.


[via] If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged