Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 x64

Trabla: Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 x64

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 x64

Apache Tomcat, often referred to as Tomcat Server, is an open-source Java Servlet Container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a "pure Java" HTTP web server environment in which Java code can run. Tomcat is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation, released under the Apache License 2.0 license, and is open-source software.

Solving:


Watch on YouTube


1. Download and install Java Development Kit 8 ( JDK 8u111 ) for Windows x64  from official site:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 1


2. Download Tomcat 8.5.9 Server ( Java Servlet Container ) for Windows x64 from official site:
https://tomcat.apache.org/download-80.cgi

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 2

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 3

3. Create folder Tomcat8 on disk C:\

e.g. C:\Tomcat8

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 4

4. Copy files from Apache Tomcat archive into folder C:\Tomcat


Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 5

5. Create two environment variables:

- goto Control Panel->System->Advanced system settings->Advanced->Environment Variables...

- add environment variable:

JAVA_HOME
C:\Program Files\Java\jdk1.8.0_111

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 6


- add environment variable:

CATALINA_HOME
C:\tomcat8

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 7


6. Add Tomcat user
- open file  C:\Tomcat8\conf\tomcat-users.xml

- add following text string into file & save & close

<user username="samuraikit" password="SamuraiKit123$%" roles="manager-gui"/>

where
samuraiki - user name, type yours
SamuraiKit123$% - user password, type yours
manager-gui - built-in role

All roles:
manager-gui - allows access to the HTML GUI and the status pages
manager-script - allows access to the text interface and the status pages
manager-jmx - allows access to the JMX proxy and the status pages
manager-status - allows access to the status pages only

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 8

7. Start Tomcat
- run file
C:\Tomcat8\bin\startup.bat
you will see windows CMD window

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 9


8. Open Browser
- goto URL
http:\\localhost:8080

- click "Manage App" button

- type user login/password and click "Login" ( from Step 6 )

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 10

Hooray !!! Enjoy Tomcat 8.5.9 !!! :)

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 11

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 12

NOTE: To shutdown Tomcat

- close Tomcat CMD window or run file C:\Tomcat8\bin\shutdown.bat

Install Apache Tomcat 8.5.9 Java Servlet Container on Windows 7 tutorial 13


XAMPP + Win7 x64 : APPCRASH httpd.exe php5ts.dll c00000fd exception

Trabla: How to FIX  XAMPP + Win7 x64 : APPCRASH httpd.exe php5ts.dll c00000fd exception 


XAMPP + Win7 x64 : APPCRASH httpd.exe php5ts.dll c00000fd exception

I'm trying to install
SilverStripe CMS v3.5.0
XAMPP 5.6.28 ( also XAMPP 5.5.38 )
and getting this error all the time

Cause:
ThreadStackSize under Windows - 1 MB (default)
under Linux - 8 MB (default)
So we need to increasde ThreadStackSize to 8MB

Discussion here:
https://community.apachefriends.org/f/viewtopic.php?p=188356

Solving:


WAtch on YouTube



1. Stop Apache

2. Add following text into
Apache config file
httpd.conf

<IfModule mpm_winnt_module>
   ThreadStackSize 8388608
</IfModule>

+ Save file

3. Start Apache


How to change XAMPP Apache default port 80

Trabla: How to change XAMPP Apache default port 80


How to change XAMPP Apache default port 80

Solving:



Watch on YouTube

1. Open XAMPP control panel

2. Stop Apache server if running

3. Click Config - Apache  httpd.conf

4.  Find all places where 80 appears
and change to port you need , e.g. 3012

5. Save & close Apache  httpd.conf

6. Start Apache

Note:
After changing port,  add port number to localhost url
e.g.
old    http://localhost/phpmyadmin
new  http://localhost:3012/phpmyadmin


CentOS & apache2: configuration error: couldn't perform authentication. AuthType not set!:

Trabla: CentOS(6.5) & apache2: configuration error:  couldn't perform authentication. AuthType not set!:


Solving:

My configuration was (  apache2 config   -  nano /etc/httpd/conf/httpd.conf  ):

<Directory /var/www/html/api >
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>


Fix ( change "Require all granted" to  "Allow from all" ):

<Directory /var/www/html/api >
        Options Indexes FollowSymLinks
        AllowOverride All
        Allow from all
</Directory>







Restart apache2:
sudo /sbin/service httpd restart

Problem discussion (I get fix from here):
http://stackoverflow.com/questions/21265191/apache-authtype-not-set-500-error 

Apache: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

Trabla: Apache: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

Solving:

1. Run command:
sudo a2enmod headers

2. Restart apache:
 sudo service apache2 restart



Apache: https config for CORS support

Trabla: Apache: https config for CORS support

Solving:

1.  Security requests from external sites
 /etc/apache2/conf-available/security.conf 

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS"

Header always set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept" 

2. For work over HTTPS from smartphone
 /etc/apache2/sites-available/default-ssl.conf

SSLCACertificateFile /etc/apache2/ssl/Geotrust-CA.cer

3.  Automatic answer for HTTP OPTIONS request
 /var/www/html/mysite/.htaccess

 #Header add Access-Control-Allow-Origin "*"
 

<IfModule mod_rewrite.c>
              RewriteCond %{REQUEST_METHOD} OPTIONS
              RewriteRule ^(.*)$ $1 [R=200,L]  

</IfModule>


4.  Update apache2.config
/etc/apache2/apache2.conf

<Directory /var/www/html/myapi  >
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>



Apache: set AllowOverride for directory

Trabla: Apache: set AllowOverride for directory

Apache Version: 2.0

Solving:

1. Go to  /etc/apache2/conf.d/

2. Open file security
sudo pico security

3. Add definition

<Directory /var/www/mydirectory/>
AllowOverride All
</Directory>


4. Save file and restart apache
sudo service apache2 restart

Apache: enable mod_rewrite

Trabla: Apache: enable mod_rewrite

Solving:

 sudo a2enmod rewrite

Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart


sudo service apache2 restart

Don't forget to Allow Directory Override in apache config
http://codingtrabla.blogspot.com/2014/12/apache-set-allowoverride-for-directory.html

Linux: restart Apache command

Trabla:  restart Apache command

Solving: 

sudo service apache2 restart