• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

929
Views
¿Cómo acceder a una api laravel en el host virtual apache?

Configuré el host virtual apache y tengo un sitio con la siguiente configuración (el sitio web funciona bien): NB: Los nombres de dominio a continuación son ficticios.

 <VirtualHost *:80> ServerName www.bill.test.com ServerAlias bill.test.com Redirect / https://bill.test.com/ </VirtualHost> <VirtualHost *:443> ServerName www.bill.test.com ServerAlias bill.test.com DocumentRoot /applications/www/bill.test.com/public_html/public SSLEngine on SSLCertificateFile /home/user1/ssl_certificate/test.com/wildcard_eneoapps_com.crt SSLCertificateKeyFile /home/user1/ssl_certificate/test.com/wildcard_eneoapps_com.key SSLCertificateChainFile /home/user1/ssl_certificate/test.com/DigiCertCA.crt ErrorLog /applications/www/bill.test.com/error.log CustomLog /applications/www/bill.test.com/requests.log combined <Directory "/applications/www/bill.test.com/public_html/public"> AllowOverride All </Directory> </VirtualHost>

Además, en este servidor tengo una API ubicada en el directorio a continuación:

 /applications/www/html/ebill-api

Ahora, cuando intento llamar a esta API en el código, aparece el siguiente error:

 Client error: `POST http://12.ipp.106.21/ebill-api/public/api/login' resulted in a `404 Not Found` response:\n

Mi archivo httpd.conf se ve a continuación:

 DocumentRoot "/applications/www/html" # # Relax access to content within /var/www. # <Directory "/applications/www"> AllowOverride None # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Require all granted </Directory>

Por favor, ayuda ya que soy nuevo en la configuración de apache y confundo por qué esto no funciona. Pude llamar a una API en un servidor separado, pero no entiendo por qué llamar a este que está en el mismo servidor que el sitio web no funciona.

over 3 years ago · Santiago Trujillo
1 answers
Answer question

0

Como tiene la API de Laravel en una subcarpeta, debe ajustar APP_URL en su archivo .env para que sea http://12.ipp.106.21/ebill-api/public/

Prueba este cambio. A ver si ayuda.

over 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error