accessing to file after upload by fabric

12 views Asked by At

I used This code to deploy the file into server `` `def do_deploy(archive_path): """ deploy archive the web servers """

if not exists(archive_path):
    return False

try:
    put(archive_path, '/tmp/')

    file = archive_path.split('/')[-1]
    file_without_ext = file.split('.')[0]

    run('mkdir -p /data/web_static/releases/{}/'.format(file_without_ext))

    run('tar -xzf /tmp/{} -C \
            /data/web_static/releases/{}'.format(file, file_without_ext))

    run('rm /tmp/{}'.format(file))

    run('mv /data/web_static/releases/{}/web_static/* \
            /data/web_static/releases/{}/'.format(
                file_without_ext, file_without_ext))

    run('rm -rf /data/web_static/releases/{}/web_static'.format(
        file_without_ext))`your text`

    run('rm /data/web_static/current')

    run('ln -sf /data/web_static/releases/{} \
            /data/web_static/current'.format(file_without_ext))

    return True

except:
    return False`

``

and Files its upload correctly and I update the nginx file in sites-availabel/default by adding this command

`    location /hbnb_static {
    alias /data/web_static/current/;
    index index.html index.htm;}`

and When I try to access to the file like this curl 100.26.230.80/hbnb_static/0-index.html it give me 404 not found Althoud the file is present the correct path

Try to access to file in web server

0

There are 0 answers