watermelon73mx
watermelon73mx

Reputation: 13

How can I deploy an Astro project to an Apache web server?

When attempting to deploy my Astro project using pnpm build, I encounter the error code:

[NoAdapterInstalled] Cannot use output: 'server' or output: 'hybrid' without an adapter. Please install and configure the appropriate server adapter for your final deployment.

The Astro project is configured for production build to be of type 'hybrid' as I need to make API calls that are on the same server. Searching the list of possible adapters on the official Astro website, there doesn't seem to be an option for Apache. Is there a way to bypass installing a server adapter? Or do I need to install an adapter from the list?

I've tried installing Deno and Netlify adapters and then placed the contents of the dist/ folder in the root of your server at /var/www/astro.site/, but still can't see the site.

Upvotes: 1

Views: 1417

Answers (1)

mb21
mb21

Reputation: 39488

You can't. Astro is written in JavaScript, not PHP. That means you'll need some kind of JavaScript runtime like Node.js or a hosted option.

as I need to make API calls

Can you do them at build-time? If so, you may still be able to do static site generation instead of the hybrid or server modes.

Upvotes: 1

Related Questions