I have a fully functioning bootstrap project. Whenever I want to access it locally I go to localhost:8080
Now I would like to run it on my server under domain name websitename.com and I want to be able to access first page of my bootstrap project without having to type websitename.com:8080 and instead just type websitename.com/
Is there any way to configure the server to do so? Or is this bootstrap configuration?
You have to change your port from 8080 to 80. This is the default http port recognized by browsers.
To achieve that you have to add line
server.port = 80
to your application.properties config file (find details in the documentation)
Note: Depending on operation system usage of 80 port might be restricted to only root user. You'll probably have to run the app with sudo or set up http proxy.
Related
I've looked over most of the documentation provided, couldn't find an absolute answer about changing jhipster-registry port, it's default is 8761, but when I try to chnage it's port through YAML config file it gets indeed working in that port but both the gateway and microservice cannot be found by the registry. am i doing anything wrong ? is jhipster-registry bound to remain intact when it comes to port manipulation ?
You must change port in spring.cloud.config.uri in all application's bootstrap*.yml so they can retrieve their config from the registry and also change it in eureka.client.defaultZone in application.yml in jhipster-registry's central-config folder if you use file system backend or in git repo if you use git backend.
This is because the registry is both a Spring Cloud Config server and an Eureka server. In JHipster's setup, the applications first connect to the config server, retrieve their config which indicate the URL of the Eureka server. As this is a common config for all apps, it's set in application*.yml in config server.
Please read also the jhipster-registry doc: https://www.jhipster.tech/jhipster-registry/
My application consists of three domains:
example.com
admin.example.com
partner.example.com
All of these domains are handled by the same Laravel app. Each domain has its own controllers and view. Models and other core functionalities are shared between all three domains.
Currently my local dev-environment is build with Homestead (based on Vagrant), where each local domain (example.test, admin.example.test and partner.example.test) points to the same directory (e.g. /home/vagrant/app/public).
Because of deployment problems regarding different versions of OS, NPM, PHP, etc. I want to move to docker. I've read a lot of articles about multiple domains or apps with docker. Best practice seems to be to set up an Nginx reverse proxy which redirects all incoming requests to the desired app. Unfortunately, I haven't found examples for my case where all domains point to the same application.
If possible I would avoid having the same repository cloned three times for each docker container running one specific part of the app.
So what would be the best approach to set up a docker environment?
I created a simple gist for you to look at of how I would do it
https://gist.github.com/karlisabele/f7d91594c004e227e504473ce2c60508
The nginx config file is based on Laravel documetation (https://laravel.com/docs/5.8/deployment#nginx) and of course in production you would also want to handle SSL and map port 443 as well, but this should serve as POC for you.
Notice that in the nginx configuration I use the php-fpm service name to pass the request to php-fpm container. In docker the service names can be used as host names for corresponding service so the line fastcgi_pass php-fpm:9000; means that you are passing the request to php-fpm containers port 9000 (default port for the fpm image to listen to)
Basically what you want to do is simply define in the nginx that all 3 of your subdomains are handled by the same server configuration. Then nginx simply passes the request to php-fpm to actually process it.
To test, you can just copy the two files from gist in your project directory, replace YOUR_PROJECT_FOLDER in docker-compose.yml file with the actual location of your project (can be simply .:/var/www/html if you place the docker-compose.yml in the root of your project) then run docker-compose up -d. Add the domains to your hosts file (/etc/hosts un linux/mac) and you should be able to visit example.test and see your site.
Note: Depending on where your database is located, you might need to change the host for it if it's localhost at the moment, because it will try to connect to a mysql server from php-fpm container, which of course does not have it's own mysql-server running.
I have laravel-backend which only provide api and vue-fontend which connected with that laravel-backend api . It's works locally fine.
But how to configure them in a single(both in same) live server(also with single domain).
Font-end is SPA. i create the font-end using "vue init webpack-simple my-project" commend.
You could use a different port for your api
By doing this you can run both applciations on the same server and access them by specifing the port in the url.
If you don't want to use ports in the url itself, you can also use nginx (or apache i suppose) with reverse proxy to give a 'path' to that port (would also be cleaner)
When I run a solution on Wakanda there is a port by default, for example 8102, but when I reload it the port changes to 8104. I would have liked to know where the port configuration is and this operation is done? In which file, or option? Because I look for it, but I can't find it.
Thanks in advance.
Update: I have confirmed that when accessed remotely (from another computer), the admin dashboard is only available via HTTPS at port 4433. :8080/admin is available on localhost only.
In order for it to work, the CORS settings need to be enabled for port 4433 as well:
HostIPAddress:4433 POST / GET / PUT / DELETE
Note: From your earlier comment it seems you have admin dashboard working on port 4433. FYI the server has an updated admin certificate, which will come out in next release. In case you have any problem with it, please wait and test with next release.
-------------------------Original Post-----------------------------------------
The admin port is set to 8080 by default. If you would like to change the default value of admin port (typically for deployment), it can be changed using Command Line/ Terminal option "--admin-port=[number]", for example:
"C:\Wakanda\Wakanda Server.exe" "C:\solutions\invoices.waSolution" "--adminport=8090"
Will change solution invoices's admin port to 8090.
You can find more options in the documentation.
I'm using Windows Server 2003. I have one web application running on IIS and another web application running on Apache Tomcat. Currently all requests go to port 80. From what I understand, Tomcat and IIS cannot use the same port simultaneously. Therefore I need a way to redirect users. If a user goes to www.example.com then I need them to use http://localhost:80 but if they go to www.otherExample.com then I need them to use http://localhost:8084/otherExample
How does this generally get done?
Set IIS to port 80.
Create two virtual hosts on IIS for your two domains.
Set the document root of the first to a directory on your IIS.
Remove the coyote http/1 connector from Tomcat.
Look here, how to redirect from your IIS to Tomcat.
Map the second virtual host to Tomcat according to the tutorial.
Then you can access example.com and otherExample.com without ports or directory changes.
Well, you should go with something like this:
First of all, I will assume that you know how to map example.com and otherexample.com to 127.0.0.1 and that is really what you want. So I will skip that part and go straight to configuration.
First of all, when users type http://www.domain.com it is EXACTLY THE SAME as typing http://www.domain.com:80. Also, when users type https://www.domain.com it is EXACTLY THE SAME as typing https://www.domain.com:443. That means, if you omit the ports for https and https, 80 and 443 are assumed respectively.
So, this brings you to only one conclusion. You have to set one web server (IIS or Tomcat) to port 80, and another to port 8084. You decide which is which, because for configuration it is irrelevant.
Now, to accomplish what you need, you need to create a redirection script on the server which listens to port 80. So, if you use PHP for redirection script, you could use something like this:
<?php
if ($_SERVER['HTTP_HOST']=='www.otherexample.com') {
Header('Location: http://localhost:8084/otherExample');
}
?>
Also, you could accomplish something similar using configuration file of the server itself (the one that is listening on port 80).
This is only general explanation of the steps you need to take. Obviously, you will need to adapt them to work for your case.
Let me know what you think.