Setting up YouTrack on custom subdomain on Ubuntu 14.04 with Plesk Onyx 17.5 - ubuntu-14.04

I want to set up YouTrack standalone on my webserver using the zip-Version.
I've uploaded and extracted all files on my server and I've created a subdomain (board.domain.de). Then I've configured YouTrack wo use another base url and to listen to another port:
./youtrack.sh configure --listen-port 1111 --base-url https://board.domain.de:2222
This is the output:
* Configuring JetBrains YouTrack 2018.1
* Setting property 'listen-port' to '1111' from arguments
* Setting property 'base-url' to 'https://board.domain.de:2222' from arguments
* JetBrains YouTrack 2018.1 runtime environment is successfully configured
* Loading logging configuration from /var/www/vhosts/domain.de/board.domain.de/youtrack-2018/lib/ext/log4j.xml
* Redirecting JetBrains YouTrack 2018.1 logging to /var/www/vhosts/domain.de/board.domain.de/youtrack-2018/logs/internal/services/bundleProcess
* Configuring Service-Container[bundleProcess]
* Configuring Bundle Backend Service
* Configuring Configuration Wizard
Then I've started YouTrack via ./youtrack.sh start which worked fine without any errors. Output:
Starting YouTrack...
* Configuring JetBrains YouTrack 2018.1
* JetBrains YouTrack 2018.1 runtime environment is successfully configured
* Loading logging configuration from /var/www/vhosts/domain.de/board.domain.de/youtrack-2018/lib/ext/log4j.xml
* Redirecting JetBrains YouTrack 2018.1 logging to /var/www/vhosts/domain.de/board.domain.de/youtrack-2018/logs/internal/services/bundleProcess
* Configuring Service-Container[bundleProcess]
* Configuring Bundle Backend Service
* Configuring Configuration Wizard
* Starting Service-Container[bundleProcess]
* Starting Bundle Backend Service
* Starting Configuration Wizard
* JetBrains YouTrack 2018.1 Configuration Wizard will be available on [https://board.domain.de:2222/?wizard_token=7bDc4UyhjyLFPmlJhkzm] after start
YouTrack is running
Clicking on the shown url, my browser opens but shows me an error. Website not reachable (ERR_CONNECTION_REFUSED). I thinks this has something to do with my apache/nginx configuration. So I've followed these instructions.
So, in Plesk under my subdomain-settings I've edited the common apache settings:
But I still get the error from above. What am I doing wrong?

It looks like the problem is in using https in base URL.
Apache config doesn't contain lines required for enabling TLS mode:
SSLEngine On
SSLCertificateFile <path_to_certificate>
SSLCertificateKeyFile <path_to_key>
This way proxy listen to plain http traffic on port 2222 while browser tries to establish secure connection.
See official documentation for mode details

Related

.Net Core not handling requests when defined in subdomain folder

I have a Linux Centos v7.9 with Apache installed. I published my web project to the server. For the backend I set it on port 90 and created a configuration file for apache with proxy server (to redirect to another port 31031, where .net 5 is listening and handling the requests. This works fine when I request my server ip with port 90. But when I wanted to set the backend as subdomain like api.domain.com and modified the configuration file, .net 5 is not handling the request anymore. When I request api.domain.com I see folder structure. What did I miss?
Here is the .conf file:
Service file:
Subdomain from cpanel:
Thanks.

Spring boot .jar to digital ocean droplet (Linux Ubuntu) :Web server failed to start. Port 80 was already in use

I have an Digitalocean Droplet (virtual private server) that has Ubuntu 18.04 running on it. I installed Apache Web Server and have my website running on it . It's open to traffic on HTTP port 80. My virtual host is setup at /var/www/MyDomainNameHere/public_html/ and I do have a custom domain name pointing to the IP.
I am trying to deploy/run a executable .jar that contains a Spring boot API. It has some basic GET/POST/DELETE HTTP requests. When I run the jar by
java -jar rest-service.jar
I get this error message
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 80 was already in use.
Does this mean the Apache Web Server that is open to Traffic on port 80 on this Digital ocean droplet won't let me run the API jar on the same server (The JAR loads up an Apache Tomcat embedded server, I set it to port 80 based on research)? Do I need to buy another droplet? Or can I maybe change the port number for the spring boot jar to something other than port 80? It's an API, so I need to be able to hit the end points
Yes, Apache Web Server using the port and you change your spring application 80 to any other port and use the reverse proxy in Apache Web server. here is the link to configure the reverse proxy
Apache as a Reverse Proxy with mod_proxy
So I will answer my own question. I googled and searched stackoverflow but most people were using the reverse proxy to direct traffic to their standalone embedded Tomcat server (most of time a Spring Boot app) which wasn't applicable to my situation.
However, I already had a static html website at alpizano.me hosted on Digital Ocean that I wanted to use as my Front-end, and only forward certain HTTP requests to my Spring Boot app, which was a REST API essentially.
So after installing Java and PostgreSQL on my DigitalOcean droplet, I SCP'd my JAR file (running ./mvnw clean package -Dmaven.test.skip=true to create it) to my server to a directory like, /var/myapp.
Then after researching for a few days and trying multiple things, I was able to figure out the combination that would allow me to view my website when navigating to alpizano.me, but still allow me to hit my API endpoints that were running on my server as-well, after I ran my jar via java -jar myapp.jar
So I basically had to set up my .conf file in the /etc/apache2/sites-available dir (I only used 1 virtual host for this project) as:
<VirtualHost *:80>
ServerName yourservername.com
DocumentRoot /var/www/yourservername.com/public_html
ProxyPreserveHost On
ProxyPass /api http://127.0.0.1:8080/
ProxyPassReverse /api http://127.0.0.1:8080/
</VirtualHost>
Notice the /api route for the routing that goes to the embedded Tomcat at port 8080 (you can't use port 80 or it will conflict with Apache Server already listening on port 80), else if it's just / , then it will not allow traffic to base website anymore (alpizano.me), which isn't what I wanted.
This wouldn't be needed if you just had a standalone app that you wanted to route traffic, then you could just use / as your route obviously. I saw other posts talking about forwarding the headers but that didn't seem to make a difference for me and I believe ProxyPreserveHost On takes care of that anyway
Good luck.
References:
https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04

How to install SSL for my website hosted in Azure?

I have hosted my website in Azure. I have created a Virtual Machine on which i have installed LAMP stack as i am using php for my website. I have a sub domain along with the main domain. I want to install SSL for both.
My client has provided me the certificate for SSL installation. I search many Stack overflow post but could not find any post helpful for a beginner like me.
Thanks
Certificate Installation: Apache 2.4.8+
Under Linux, to check the version number of your Apache server, execute the following command:
apache2ctl -version
or
apachectl -version
Note : If your Apache server's version is less than 2.4.8, please skip this article and go this link
Prerequisites:
Concatenate the CAbundle and the certificate file which we sent you using the following command.
cat domain_com.crt domain_com.ca-bundle > ssl-bundle.crt
If you are Using GUI Text Editor (Ex: Notepad):
(i) To concatenate the certificate files into single bundle file, first open domainname.crt and domainname.ca-bundle files using any text editor.
(ii) Now copy all the content of domainname.crt and paste it on the top of domainname.ca-bundle file.
(iii) Now save the file name as ‘ssl-bundle.crt’.
Configure the Apache server:
Locate the Apache configuration file (example httpd.conf / ssl.conf), the configuration file name can be different depending on your apache version or flavour. Or in a Windows environment (EasyPHP, Wamp, ...) :
C:\Program Files\Apache Software Foundation\Apache X.X\conf\SSL2015
C:\Program Files\Apache Software Foundation\EasyPHP\SSL2015
In a standard installation under Linux, the SSL advanced configuration file is located here:
/etc/apache2/mods-enabled/ssl.conf
but it is not in this file that you will activate the certificate for a website. You'll have to edit the file
/etc/apache2/sites-enabled/default-ssl.conf
Use the following command to figure out where Apache is pulling its configuration from:
apache2ctl -V | grep SERVER_CONFIG_FILE
or just
apachectl -V | grep SERVER_CONFIG_FILE
The situation for ubuntu on Apache differs, as the configurations for 443 and 80 ports for each site are located in separate files. You can find it at /etc/apache2/sites-enabled/ Edit or create the file with the VirtualHost for 443 port to set up the secure connection.
Actually you can duplicate the record for port 80 (should be in your VirtulHost file by default) and change port 80 to port 443. Simply add it below non-secure module.
In the Virtual Host settings for your site, locate the SSL certificate settings section and verify that you have the following 2 directives within the Virtual Host. Please add them in if they are not present:
SSLCertificateKeyFile ( path to the private_key.key file used for the initial generation of the CSR)
SSLCertificateFile ( path to the PEM file containing the end entity certificate and the intermediates )
Example VirtualHost Configuration:
DocumentRoot /etc/httpd/htdocs
ServerName comodo.com
SSLEngine on
SSLCertificateFile /usr/local/ssl/crt/ssl-bundle.crt
SSLCertificateKeyFile /usr/local/ssl/private/private.key
Note: As with the example above, file names can be domainname.crt, server.key, your server however may use a different naming convention. If you are using a different file location than the example above, you will need to change the paths to match your files on the server.
If you want to enable OCSP Stapling for the website, please add the following directive to the Virtual Host section:
SSLUseStapling on
Also specify OCSP cache response location and size outside of the Virtual Host section using SSLStaplingCache directive:Converting a SSL certificate in Apache to Windows
SSLStaplingCache shmcb:/tmp/stapling_cache(128000)
Note: OSCP Stapling can be configured starting from Apache HTTP server 2.3.3 and later.
After making changes to your config file it is good practice to check the file for syntax errors using "apachectl configtest". The command will return Syntax Ok if there are no errors.
Restart your apache web server:
apachectl stop
apachectl start
To verify if you have correctly installed the SSL, please use our SSL Analyzer.
You can check this link.
https://support.comodo.com/index.php?/Knowledgebase/Article/View/1185/0/certificate-installation-apache-248
Is in azure provided free SSL? Otherwise you will not be able to install SSL with green bars. You can donate at https://letsencrypt.org/ to get SSL service with low price and develop your website even better.

Teamcity server url returns 404

I installed TeamCity on a windows server 2016 machine and I assigned the ci.mydomain.com to the serverUrl. I have IIS also on that machine that hosts my nuget server.
When I type in ci.mydomain.com it returns a 404. nuget.mydomain.com works fine
Does anyone knows why?
Thanks in advance
"Server URL" in TeamCity administration settings does not affect how TeamCity server can be accessed.
You can start by opening 127.0.0.1:PORT on the server machine to check that the TeamCity is running OK, where PORT is where TeamCity is configured to run on (e.g. check \logs\teamcity-server.log file, line with "Web server ports")
If that works, make sure SERVER:PORT works from other machines, where SERVER is the machine IP and the same PORT. If you'd rather use IIS as a reverse proxy, check related TeamCity instructions.
Finally, you will need to make sure ci.mydomain.com resolves to the IP and use due port in the URL.

Deploying WAR file in Amazon AWS - Tomcat and Apache HTTP Server conflict

I'm using an Amazon Linux AMI instance and I've deployed a war file on it.
The deployed war file shows up in the 'webapps' folder of tomcat6.
The real problem is - Apache HTTP 2.2 server is also installed.
When I access my instance's URL (http://ec2-107-20-92-32.compute-1.amazonaws.com), I see the default page of Apache HTTP 2.2 Only, which, if I'm not wrong, works on port number 80.
Now, how do I get my Apache HTTP 2.2 Server communicate with tomcat6 to display the website deployed in Tomcat?
Or, are there any other alternatives to it?
(I use MacOS X's terminal to connect to my Instance and I uploaded the WAR on S3 to deploy it in tomcat.)
TIA :)
In addition to mac's suggestions (shutting down Apache and making Tomcat listen at port 80, or configuring the Tomcat connector on Apache), you might also set a pair of ProxyPass/ProxyPassReverse directives on your Apache configuration, like the example at mod_proxy documentation.
If you decide to follow this suggestion, your rules would look like follows (in the VirtualHost listening at port 80):
ProxyPass / http://ec2-107-20-92-32.compute-1.amazonaws.com:8080/
ProxyPassReverse / http://ec2-107-20-92-32.compute-1.amazonaws.com:8080/
Nothing worked.
I deleted the instance and tried the same with Ubuntu 12.04 64 bit instance, it worked.
I have no clue why it didnt work in Amazon Linux AMI :(

Resources