# Can i use traefik without a web server?

**URL:** https://community.traefik.io/t/can-i-use-traefik-without-a-web-server/5536
**Category:** Traefik v2
**Tags:** docker
**Created:** [April 16, 2020, 4:52pm UTC](https://community.traefik.io/t/can-i-use-traefik-without-a-web-server/5536 "2020-04-16T16:52:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![devwinner](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@devwinner](https://community.traefik.io/u/devwinner)
#### Post date: [April 16, 2020, 4:52pm UTC](https://community.traefik.io/t/can-i-use-traefik-without-a-web-server/5536/1 "2020-04-16T16:52:02Z")

</div>

Hello. I'm new at traefik. Before, i used to use apache2 to create a virtual host configuration files for my services (websites, web services,...) before deploying them . Now, i decide to move to traefik. But there is something i don't understand:

- When i want to publish a website project on my server with traefik (docker), do i need to create an apache configuration file (for the website) again before creating my docker service?

I have followed lot of tutoriels and in most of them, they ask to give the hostname and the port of the service in docker with labels. But if there is no apache2 virtual host file, will it works?

I'm using traefik 1.7. Without creating apache2 configuration file, i can deploy an html web site with traefik by using httpd:alpine image. But when i try it with php websites , i have error with fonctions require\_once or include.

---

<div class="post-metadata">

### Author: ![devwinner](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@devwinner](https://community.traefik.io/u/devwinner)
#### Post date: [April 16, 2020, 5:03pm UTC](https://community.traefik.io/t/can-i-use-traefik-without-a-web-server/5536/2 "2020-04-16T17:03:38Z")

</div>

docker-compose file:

```auto
version: '3'
services:
  traefik:
    image: traefik:alpine
    command: --api --docker
     #--docker --docker.domain=traefik.local.lan
    ports:
      - 80:80
      - 8080:8080
    volumes:
       - /var/run/docker.sock:/var/run/docker.sock
       - /etc/apt/traefik/traefik.toml:/etc/apt/traefik/traefik.toml
  website:
    image: php:7.3-apache
    container_name: website
    labels:
      - traefik.frontend.rule=Host:phpsite.local.lan
      - traefik.port=80
      - traefik.enable=true
    volumes:
      - ${PWD}/webapp:/var/www/html

```

In this example i have a php website in `${PWD}/webapp/`. When i access [http://phpsite.local.lan](http://phpsite.local.lan), i have error :

```auto
Fatal error: require_once(): Failed opening required '/var/www/html/loader.php (include_path='.:/usr/local/lib/php') in /var/www/html/index.php on line 11

```

But when i change php website to html website content, it works well
