1

Apache conf:

/etc/apache2/sites-available/andyrojaslab08.tk.conf

<VirtualHost *:80>
       ServerName andyrojaslab08.tk
       DocumentRoot /var/www/andyrojaslab08.tk/repo333

       ProxyPreserveHost on
       ProxyPass  /  http://127.0.0.1:8080/
       ProxyPassReverse  /   http://127.0.0.1:8080/

       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Error Logs from Apache:

 [proxy_http:error] [pid 7970:tid 140567970084416] [client 127.0.0.1:33122] AH01114: HTTP: failed to make connection to backend: 127.0.0.1

 Connection refused AH00957: http: attempt to connect to 127.0.0.1:8080 (127.0.0.1) failed

etc/hosts:

 127.0.0.1       andyrojaslab08.tk
 127.0.1.1       andyrojaslab08.tk
 192.168.139.128    andyrojaslab08.tk

 ::1     ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters

proyect structure:

    andy@andy-virtual-machine:/var/www/andyrojaslab08.tk/repo333$ ls
    app.yaml  HELP.md  mvnw  mvnw.cmd  pom.xml  src  target

proyect path:

    andy@andy-virtual-machine:/var/www/andyrojaslab08.tk$ ls
    goodbst.jar  Lab02-Rojas-0.0.1-SNAPSHOT.jar lab08xy.jar  repo333

app.yaml from proyect:

    runtime: java17
    server.port=8080

resources from my proyect:

    andy@andy-virtual-machine:/var/www/andyrojaslab08.tk/repo333/src/main/resources$ ls
    application.properties  static  templates

application.properties:

    spring.jpa.show-sql = true
    spring.jpa.hibernate.ddl-auto = update
    spring.datasource.url =jdbc:mysql://xxxxxx:3306/xxxxxx
    spring.datasource.username =xxxxx
    spring.datasource.password =xxxxx
    spring.thymeleaf.prefix=classpath:/templates/
    spring.thymeleaf.suffix=.html
    server.port=8080

Error:

    andy@andy-virtual-machine:/$ curl andyrojaslab08.tk

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>503 Service Unavailable</title>
    </head><body>
    <h1>Service Unavailable</h1>
    <p>The server is temporarily unable to service your
    request due to maintenance downtime or capacity problems. Please try again later.</p>
    <hr>
    <address>Apache/2.4.52 (Ubuntu) Server at andyrojaslab08.tk Port 80</address>
    </body></html>

Error on web:

enter image description here

(I am using thymeleaf in html, and my html files are in src/main/resources/templates)

(I am using mysql database from the cloud, i already verified that the problem does not come from there)

(My css files are in src/main/resources/static)

(I am using apache2)

(i installed maven)

  • 1
    The apache error says it cannot connect to port 8080. Is the Spring Boot App running? – grekier May 24 '23 at 07:20
  • do i need to run springboot app? i thought that already was made by the dominio, in this case how can i run the springboot app of a proyect, is it possible that instead of my springboot project called "repo333", i can use a jar executable springboot app? – Andy Salim Rojas Hinojosa May 24 '23 at 08:45
  • Yes. You need to run the app. How would you expect it to work without it running? Source code in an apache folder makes no sense except if you want to show your code on the web. There are multiple way to run the app but easiest is probably to package as jar and run `java -jar .jar` (that should not be in the apache folder if you do not wish to share the code). The command assume that you have the correct java version installed on the server obviously. – grekier May 24 '23 at 08:57

0 Answers0